Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- LocalScript
- -- Wait for the player
- local player = game.Players.LocalPlayer
- -- Function to set up the "Knocked" reset behavior
- local function setupKnockedListener(character)
- local knockedValue = character:WaitForChild("Knocked")
- -- Ensure "Knocked" resets to false whenever it's set to true
- knockedValue:GetPropertyChangedSignal("Value"):Connect(function()
- if knockedValue.Value == true then
- knockedValue.Value = false
- end
- end)
- end
- -- Listen for the player's character to be added
- player.CharacterAdded:Connect(function(character)
- setupKnockedListener(character)
- end)
- -- If the character already exists when the script starts
- if player.Character then
- setupKnockedListener(player.Character)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement