So I was trying to script something where you can type your speed value.
Here’s the script.
Value.Text is where I will be inserting the value in-game.
local repStorage = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")
local Event = repStorage:WaitForChild("Speed")
local List = game.StarterGui.Admin2.Commands.List.TextButton
local value = game.StarterGui.Admin2.Commands.Value.Text
Event.OnServerEvent:Connect(function(plr, targetName)
local target = players:FindFirstChild(targetName)
if target then --check for the player (again cuz the check on the client is bypassable with exploits)
local char = plr.Character
if char then
local hum = char:FindFirstChildOfClass("Humanoid")
if hum then
hum.WalkSpeed = value
end
end -- Your script to kill here (target is the player to kill)
print(plr.Name .. " speed " .. targetName)
end
end)
I did so but didn’t work as well
Edit:One of the problems was because of the ReplicatedStorage Target being wrong,corrected it now but still doesn’t fix it.
PlayerGui is accessed from the Player instance. Whatever someone types into a textbox, it’s only visible to the client so you need to send that with the remote event.
local repStorage = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")
local Event = repStorage:WaitForChild("Speed")
local List = game.StarterGui.Admin2.Commands.List.TextButton
Event.OnServerEvent:Connect(function(plr, targetName)
local target = players:FindFirstChild(targetName)
if target then --check for the player (again cuz the check on the client is bypassable with exploits)
local value = plr.PlayerGui.Admin2.Commands.Value.Text
local char = plr.Character
if char then
local hum = char:FindFirstChildOfClass("Humanoid")
if hum then
hum.WalkSpeed = tonumber(value)
end
end -- Your script to kill here (target is the player to kill)
print(plr.Name .. " speed " .. targetName)
end
end)