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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Making it so Slime Damage can Kill, need help!
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#2
RE: Making it so Slime Damage can Kill, need help!

Perhaps try using this line of code:

PHP Code: (Select All)
GivePlayerDamage(float afAmountstringasTypebool abSpinHeadbool abLethal); 
afAmount - amount of damage done to health
asType - plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws or Slash)
abSpinHead - changes the camera view when damage is dealt
abLethal - set to true if player can die from given damage

Edit: I see you have used it, but used it incorrectly.

A float is a decimal number between 0 and 100.
A string is a line of text which is enclosed in quotation marks ( "" )
A bool is a boolean, which means true or false.

If you want it in the correct format, right at the bottom of the code I did in this spoiler, you should find one which works!

Edit 2:
I may have misinterpreted - My one (should) work if the door should NOT open, which would fail the puzzle. If it is incorrect, use First Captain's solution below me Smile

Spoiler below!

Your code is also a bit messy - it almost seems that it would crash when you run it :o
PHP Code: (Select All)
void OnStart()
{
AddEntityCollideCallback("Player""checkpoint_00""Restart"true1);
AddEntityCollideCallback("Player""damage_zone01""GivePlayerDamage"true1);
}

void Restart(string &in asParentstring &in asChildint alState)
{
CheckPoint("FirstCheckpoint""respawn_001""Happening""DeathCategory""Deathtext");
}

void Happening(string &in asNameint alCount)
{
//When you respawn, if anything is supposed to happen, put it here.
}

void move_top_down(string &in asEntityint alState)
{
if(
alState == 1)
{
SetMoveObjectState("top_door"1.0f);
}
else
{
GivePlayerDamage(100.0f"blood"falsetrue); //Will instantly kill the player if they do the wrong thing.



Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 08-15-2014, 08:40 AM by Romulator.)
08-15-2014, 08:34 AM
Find


Messages In This Thread
RE: Making it so Slime Damage can Kill, need help! - by Romulator - 08-15-2014, 08:34 AM



Users browsing this thread: 1 Guest(s)