Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Could someone identify what is wrong with this player speed code?

So this code is meant to stop the player moving by pressing g and after 5 seconds return the players speed. ``

function Remove() game.Workspace.Player1.Humanoid.WalkSpeed = 1 end

function Go() game.Workspace.Player1.Humanoid.WalkSpeed = 16 end

function time() remove() wait(5) Go() end local function onKeyDown( key ) print("g", key, " time:", string.byte(key)) end ``

2 comments

1

Use the god damn code block.

0

I cannot understand the code properly as it hasn't been put in a code block.

1 answer

✓ Accepted answer

Did you identify the player correctly? I'm not sure, It looks like you didn't really tell the script where the player is.

local Player = game.Players.LocalPlayer
--This grabs the player that clicks or performs the function.

If this helped or whatever, Please, Accept my answer by clicking "Accept Answer".

2 comments

0

There may be other issues with your script as well.

0

This also needs to be in a LocalScript.

This discussion is preserved as it was. New answers, comments, and votes are closed.