How do I check if a player touched a part from a local script? I want to make it so they get sped 0 when it’s detected.
My current code doesn’t work:
local ddajki = workspace.dd.ddajki
local fs = workspace.fs.flyingstone
ddajki.Touched:Connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
hit.WalkSpeed = 0
end
end)
ddajki.Touched:Connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
hit.WalkSpeed = 0
end
end)
This is in StarterCharacterScripts FYI.