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

FE script that sets a player's walkspeed won't work. Any ideas why?

The serverside script:

script.Player.SetSpeed.OnServerEvent:connect(function(SelectedFigure,SelectedSpeed)
	game.Workspace:FindFirstChild(SelectedFigure).Humanoid.WalkSpeed = SelectedSpeed
end)

The clientside script:

script.Parent.MouseButton1Down:connect(function()
	game.Workspace.FusionServer.Player.SetSpeed:FireServer(script.Parent.Parent.Parent.SelectedPlayer.Value,script.Parent.Parent.SpeedBox.Text)
end)

Any idea why it won't work?

3 comments

0

It could be much simpler.... Simply fire an event to notify the server a button was pressed and the server can figure the rest out by searching for values etc. I personally would recommend it. I often had errors with remoteevents/functions because I messed up parameters.

0

Since you're changing the players own speed, you can modify it locacly.

0

No no, in the gui you select a player to get modifed.

1 answer

You can actually just modify WalkSpeed on the client, but the reason why this isn't working seems to be that

workspace:FindFirstChild()

Is trying to look for the player instead of a string, so you can fix this just by putting

SelectedFigure.Name

1 comment

0

Sorry for the late response, but no, it gets the name from a value

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