I want to destroy a block if the player’s walkspeed is above a certain amount. But when I tried to do this it didn’t work, can someone explain my problem?
local part = script.Parent
local function Touch(partTouched)
local partparent = partTouched.Parent
local humanoid = partparent:FindFirstChildWhichIsA("Humanoid")
if humanoid then
if humanoid.WalkSpeed >= 32 then
print("yes")
part:Destroy()
end
end
end
part.Touched:Connect(Touch)
It won’t be replicated to the server, even if they player is walking faster. The server will still think the player’s walk speed is the default. You could print this in your script to confirm. Try moving the walk speed change to a server script.
I couldnt change it to a server script because the script that changes the speed required the user input. Instead I used a remote event which works perfectly fine.