Hello, I put a click detector on a part and this code :

function onClicked(playerWhoClicked)
	playerWhoClicked.PlayerGui.Model.Humanoid.WalkSpeed = playerWhoClicked.PlayerGui.Model.Humanoid.WalkSpeed + 10
	print(playerWhoClicked.PlayerGui.Model.Humanoid.WalkSpeed)
end
 
script.Parent.ClickDetector.MouseClick:connect(onClicked)

The problem is that it prints corretly the speed, but in the game I don't walk faster Can someone explain me why it doesn't work ? I don't understand, how to fix this...

same for this code :

function onClicked(playerWhoClicked)
	if playerWhoClicked.PlayerGui.Model.Humanoid.WalkSpeed >=27 then
		playerWhoClicked.PlayerGui.Model.Humanoid.WalkSpeed = playerWhoClicked.PlayerGui.Model.Humanoid.WalkSpeed - 10
	end
end
 
script.Parent.ClickDetector.MouseClick:connect(onClicked)

Thank you, for your answers :p

2 comments

0

Are you trying to edit the walkspeed of normal characters? if so, why are you looking for them inside PlayerGui?

0

It is nowhere there is no way to get real walkspeed exept when people wall on the thing i can get it but else i can't :(