local part = script.Parent
part.Touched:connect(function(hit)
local hum = hit.Parent:FindFirstChild("Humanoid")
if hum then
hum.WalkSpeed = 0
local player = game.Players:GetPlayerFromCharacter(hum)
player.PlayerGui.PlantBombA.Frame.Visible = true
if player.PlayerGui.PlantBombA.Frame.Visible.Changed then
hum.WalkSpeed = 16
end
end
end)
The error is...
16:45:04.936 - Workspace.PlantDetector.Script:7: attempt to index local 'player' (a nil value)
Thanks in advance for any help you may provide!

1 comment
try hum.Parent It might be that you are using Humanoid and not the character model