Frictional Games Forum (read-only)

Full Version: Help me! Help me now! :(
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys, this is my first post!

I've been trying to learn the basics of scripting, and I find it rather difficult! Blush Anyhow; I tried to make a key work to a door, but I just can't seem to get it right... Here's the script I've written:


void Onstart()
{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");
}

Where did I get it wrong?
Onstart is not OnStart.
Thanks man! Works like a charm. It's interesting that one letter can make everything fall apart! xD
Oh, wow. I had no idea scripts were cAsE SeNsItIvE! Thanks YC, AGAIN!
(04-05-2012, 07:58 PM)JetlinerX Wrote: [ -> ]Oh, wow. I had no idea scripts were cAsE SeNsItIvE! Thanks YC, AGAIN!
But you've released mods and made over 400 posts here! Now I'm all kinds of confused. That's one of the first things you learn. Huh

I've always just used the correct capital letters! XD