Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Wooden Board Block destroy script
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#2
RE: Wooden Board Block destroy script

That is not so easy to explane but here we go.
You need to have a couple of things here :
1: Open the level editor and add the "wooden_boards_block"
2: Open the level editor and add the "wooden_boards_block_broke" (at the same spot offcourse) <-- Make this UNACTIVE in the level editor
3:Add a hammer in your lvl editor and name it Hammer_1 ( i assume the hammer is an item )
4:Here is the script you should put on OnStart:

PHP Code: (Select All)
AddUseItemCallback("""Hammer_1""wooden_boards_block""ActivateBrokenBoards"false); 

5:Here is the script you can use. ( you can change or add stuff at your own will )
PHP Code: (Select All)
void ActivateBrokenBoards(string &in asItemstring &in asEntity)
{
SetEntityActive("wooden_boards_block"false);
SetEntityActive("wooden_boards_block_broke"true);
RemoveItem("Hammer_1");
GiveSanityBoostSmall();
CreateParticleSystemAtEntity("""ps_cog_stone.ps""BoardParticles"false);
CreateParticleSystemAtEntity("""ps_break_mansionbase_wall.ps""BoardParticles"false);
PlaySoundAtEntity("""player_crouch""Player"0.0ffalse);    
PlaySoundAtEntity("""break_wood.snt""Player"0.0ftrue);


If you want, you can add some particles to it.
Then simply add 1 ScriptArea called : BoardParticles in the middle of the wooden boards.
I have added the particle effect in your script already.
---
IF you want to make it like, you want to see a hammer moving...
Then it is a little\lot more complicated.
Let us know if you want it like this or with a moving visable hammer.
(This post was last modified: 05-24-2014, 11:51 AM by DnALANGE.)
05-24-2014, 11:35 AM
Find


Messages In This Thread
Wooden Board Block destroy script - by MaksoPL - 05-24-2014, 11:20 AM
RE: Wooden Board Block destroy script - by DnALANGE - 05-24-2014, 11:35 AM



Users browsing this thread: 3 Guest(s)