Putmalk
Senior Member
Posts: 290
Threads: 13
Joined: Apr 2012
Reputation:
15
|
RE: How do i make the Sanity script?
(05-25-2012, 03:03 PM)Clear Wrote: (05-25-2012, 02:57 PM)wolfmaster1231 Wrote: AddEntityCollideCallback("Player", "Sanity1", "SanityDamage", true, 1) this should be under
AddUseItemCallback
Can you write that for me please? Check my post, I did it for you.
|
|
05-25-2012, 03:04 PM |
|
Clear
Junior Member
Posts: 19
Threads: 4
Joined: May 2012
Reputation:
0
|
RE: How do i make the Sanity script?
(05-25-2012, 03:01 PM)Putmalk Wrote: (14, 1) refers to line 14, character 1.
In this case, you are misusing the "{" "}". They cannot be floating around there. May I suggest reviewing a basic scripting tutorial, as syntax errors like these will stop you from doing anything.
When utilizing those brackets, they have to be after a function.
Like:
void OnStart()
{
}
Alternatively, after an if-else statement:
if(whatever)
{
}
else
{
}
or a loop
for(int i=0;i<5;i++)
{
}
So, specifically, your error is right here:
{
AddEntityCollideCallback("Player", "Sanity1", "SanityDamage", true, 1);
}
Just shift that into the original void OnStart(), so it looks like
void OnStart()
{
AddUseItemCallback("", "key1", "DoorName01", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "Sanity1", "SanityDamage", true, 1);
}
And remove that line plus the brackets where you had it.
IT WORKED! I WANNA GIVE YOU A HUG AND I WANNA HUMP YOU AND I.... I mean, *cough* thank you kind sir.
|
|
05-25-2012, 03:14 PM |
|
Putmalk
Senior Member
Posts: 290
Threads: 13
Joined: Apr 2012
Reputation:
15
|
|
05-25-2012, 03:18 PM |
|