I want to get change the bool value to true in every player in the workspace using this script:
Fixed Thank you!
local debounce = false
local charVariable
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Wait()
charVariable = player.Character
end)
local path = game:GetService("StarterPlayer").StarterCharacterScripts
local Character = game.Players.LocalPlayer.Character.Combat.Isworking
function getPlayer(humanoid)
local players = game.Players:children()
for i = 1, #players do
if players[i].Character.Humanoid == humanoid then return players[i] end
end
return nil
end
function onTouch(part)
local character = part.Parent
local human = part.Parent:findFirstChild("Humanoid")
if (human ~= nil) and debounce == false then
debounce = true
local player = getPlayer(human)
if (player == nil) then return end
if Character.Value == false then
Character.Value = true
debounce = false
return
end
wait(0.1)
debounce = false
end
end
script.Parent.Touched:connect(onTouch)
Note The script may not work because it is not finished