Frictional Games Forum (read-only)

Full Version: what do i need to do...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i want that player is walking "slower"
because i made something... afterp ulling a lever a wall is going up... and a music will come.. some music that it looks like it's the end and then there is outside... andthe music is long... i want that player CAN'T run... for that time... what's the script for player walk... (not run Sad )
|( but it's not the end of the game Big Grin )
Hello there!
This page may be very helpful to you in the future. But to answer your question:
SetPlayerWalkSpeedMul(0.7)
SetPlayerRunSpeedMul(0.4)

Or you could use
SetPlayerMoveSpeedMul(0.5)

You can replace the numbers in the brackets with whatever you want. Higher than one is faster than normal, lower than one is slower than normal.
I'm guessing you mean this?

Code:
void SetPlayerMoveSpeedMul(float afMul);
void SetPlayerRunSpeedMul(float afMul);
void SetPlayerLookSpeedMul(float afMul);

Changes the player's move/run/look speed. Default is 1.
thanks Big Grin but it keep saying error end of file or something ? my script
PHP Code:
void OnStart()
{
AddUseItemCallback("""Cellar""CellarDoor""UsedKeyOnDoor"true);
AddUseItemCallback("""Mes""Barrel""Killperson"true); 
PlayMusic("Kasteel"true0.7f10false);
}


void MoveWall(string &in asEntityint alState
{
    if (
alState == -1)
    {
        
SetMoveObjectState("MoveWall"1);
        
SetLeverStuckState("secretlever", -1false);
        
PlaySoundAtEntity("""quest_completed.snt""MoveWall"0false);
                
StopMusic(51);
                
PlayMusic("Outside"true0.7f10false);
                
SetPlayerMoveSpeedMul(0.5)

    }

void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
SetLevelDoorLocked("CellarDoor"false); 
PlaySoundAtEntity("""unlock_door.snt""CellarDoor"0false);
RemoveItem("Cellar");


void BarrelCreak(string&in asParentstring &in asChildint alState)
{
PlaySoundAtEntity("""break_wood.snt""Barrel"0.5ffalse);
SetPropHealth("Barrel"0);
}

void Killperson(string &in asItemstring &in asEntity)
{
PlaySoundAtEntity("""19_inject.snt""Player"0false);
CreateParticleSystemAtEntity("""ps_blood_tiny_splash.ps""Barrel"false);
SetEntityActive("secretlever"true);

No bracket at SetPlayerMoveSpeedMul.

Also you're missing a } closing this script.

Needs to be like this:

Code:
void MoveWall(string &in asEntity, int alState)
{
    if (alState == -1)
    {
        SetMoveObjectState("MoveWall", 1);
        SetLeverStuckState("secretlever", -1, false);
        PlaySoundAtEntity("", "quest_completed.snt", "MoveWall", 0, false);
                StopMusic(5, 1);
                PlayMusic("Outside", true, 0.7f, 1, 0, false);
                SetPlayerMoveSpeedMul(0.5);

    }
}
Thnaks Big Grin it worked Tongue
Wink