How would I make it where when a player takes damage, they wouldn't be able to be hurt again until a few seconds. During this period it would make the player flash from invisible then visible again until they are able to be hurt again. Just like mario, when you get hurt, mario flashes and cant get hurt until he stops flashing. How would I do that?
Just insert a value into the player through a script.
ServerScriptService
game.Players.PlayerAdded:connect(function(player) local state = Instance.new("StringValue",player) state.Name,state.Value = "State","Normal" end)
From there just have everything check if the player's state is set to normal.
local player = game.Players.LocalPlayer repeat print("Loading") wait() until player.Character ~= nil local character = player.Character local delay = 3 local states = {"Normal","Hurt"} player.State.Changed:connect(function() if player.State.Value == states[2] then wait(delay) player.State.Value = states[1] end end)
Pretty sure this should work.