I'm not very good at coding and just looked into debounces as it was the solution to my neverending problem. Thing is, im not very good with them. Can someone please fix my script and explain to me what i did wrong? Here's my attempt if you can even call it one. No errors, nothing prints either.
while wait(0.1) do
local Teams = game:GetService("Teams")
local player = game:GetService("Players").LocalPlayer
local char = player.Character or player.CharacterAdded:wait()
repeat wait() until char:FindFirstChild("Humanoid")
local human = char.Humanoid
local forcefield = Instance.new("ForceField")
debounce = false
if forcefield.Parent == char then
debounce = true
end
if player.Team == Teams["Safe"] then
debounce = false
if forcefield.Parent == char then
print("like the game to be pog")
forcefield.Name = "NewForceField"
forcefield.Parent = player.Character
end
end
end

1 comment
k no need for optimization ill do that later