✓ Accepted answer
Hi! Scripting Helpers is not a request site, but I'm feeling extra generous today.
Here's what you'll need:
https://developer.roblox.com/en-us/api-reference/function/RemoteEvent/FireServer
First off, we need a text box. Make a ScreenGui and in it, make a TextBox. Keep the name TextBox.
Now, create a RemoteEvent. Put it in ReplicatedStorage.
Ok, in the TextBox make a LocalScript.
We'll start off by detecting when the text changes.
script.Parent:GetPropertyChangedSignal("Text"):Connect(function()
end)
All done? Now, we need to fire the remote event.
script.Parent:GetPropertyChangedSignal("Text"):Connect(function()
game:GetService("ReplicatedStorage").RemoteEvent:FireServer(script.Parent.Text)
end)
Time to move to the server. Make a server script and put it anywhere.
Let's make the code.
local RE = game:GetService("ReplicatedStorage").RemoteEvent
function RE.OnServerInvoke(plr, args)
end
Now we need to change the walkspeed.
local RE = game:GetService("ReplicatedStorage").RemoteEvent
function RE.OnServerInvoke(plr, args)
local hum = plr.Character.Humanoid
if tonumber(args) then
hum.WalkSpeed = args
end
end
Hope this helped!
12 comments
Thank you so much!
Why not change WalkSpeed on the client?
Could you mark it as answer again? I accidentally edited it.
Changing walkspeed on the client is unreliable.
It's not unreliable, it just fools anti-exploits sometimes.
I would suggest not doing it.
I got an error in the server script, line 2 saying that OnServerInvoke isnot a valid member of RemoteEvent. I am currently trying to fix it.
Do OnServerEvent instead. My mistake.
On Server Invoke isn't a function of remote event, it's a function of remote function.
Thanks!
Hmm, It says OnServerEvent isn't a valid member of remote event either... That's weird, I'm sure it is...
That's strange. I'm not sure how to fix that. It's not working