How to detect movement

I want to recreate the game “Red Light - Green Light” from the series, squid game. If you don’t know what it is, pretty much if it’s red light you can’t move and if it’s green light you move but if you move on red light you die. So I need a way to detect if a player moves if it’s red light but I don’t really know how so any help would be very appreciated!

Spawn a type of damaging brick
(From toolbox or something if you want)
So it won’t kill you unless you move in it
Then if a player moves after it was spawned, it should damage or kill them

Also try like

wait(0.1)
Character(path plr’s character).Humanoid.Health.Changed:Connect(function()
— kill function
end)
So that after red light, wait a fraction of all second so that when a player moves
They die after the change function
also make the damage block do 1 damage if you try this path

Sorry for long post LOL

1 Like

I would check this post out, it’s helpful for your issue. I would also add a bit of a delay when detecting when the player stops walking maybe 0.1 - 0.3 seconds just so they have a chance to stop.

1 Like

You can use the Humanoid.Running event to detect when the player is running
Learn more: Humanoid | Roblox Creator Documentation