Frictional Games Forum (read-only)

Full Version: How to make player teleport when touching item?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
So how because i have no idea..

I tried to Teleport function and combine item with that but not working..

Somebody give me example?

Thanks.
Don't use combine item, use SetEntityPlayerInteractCallback. Then, when they interact with the item (pick it up, carry it, etc.) they will be teleported.
(04-08-2011, 04:08 PM)Anxt Wrote: [ -> ]Don't use combine item, use SetEntityPlayerInteractCallback. Then, when they interact with the item (pick it up, carry it, etc.) they will be teleported.

Uhm.. Can you show me example script for teleporting when touching or picking up item?
void OnStart()
{
SetEntityPlayerInteractCallback("key", "Stuff", true);
}
void Stuff(string &in asEntity)
{
TeleportPlayer("PlayerStartArea");
}
Thanks but one thing how i can add there when player is teleporting he scares and fades like timer... Now its only changing area quick when i pick lantern..
Use a timer instead of directly teleporting the player. When the player picks up the lantern, use the FadeOut function and set the timer to the same time as the fadeout. Then, have the timer call a function that teleports the player and fades back in.
(04-08-2011, 06:15 PM)Anxt Wrote: [ -> ]Use a timer instead of directly teleporting the player. When the player picks up the lantern, use the FadeOut function and set the timer to the same time as the fadeout. Then, have the timer call a function that teleports the player and fades back in.

Its not working...

void Stuff(string &in asEntity)
{
TeleportPlayer("PlayerStartArea_2");
FadeIn(float 5.0f);
FadeOut(float 5.0f);
}

Complains many errors...
Don't have the word float in your fade functions.

Also, that's not what I meant. Here's what I meant:

void OnStart()
{
SetEntityPlayerInteractCallback("key", "Stuff", true);
}

void Stuff(string &in asEntity)
{
FadeOut(5);
AddTimer("tele", 5, "Teleport");
}

void Teleport(string &in asTimer)
{
FadeIn(5);
TeleportPlayer("PlayerStartArea_2");
}
Oh good.. its working now..

Im so stupid and noob at scripting its too hard Sad
It gets easier with time. Just be patient with it and you'll learn how to do pretty much everything.
Pages: 1 2