So, Still making a script for my friend. Now, My script isn't working at all! :( No output errors.
It is a normal script located in Workspace > TouchPart
UPDATED :
game.Workspace.TouchPart.Touched:Connect(function(hit)
-- I will ignore your other code for now
local part = script.Parent
local debounce = false
if hit.Parent:FindFirstChild("Humanoid") then -- will tell you if what hit it is a player
local players = game:GetService("Players")
local plar = players:GetPlayerFromCharacter(hit.Parent) -- getting the player from the players service by providing the character.
if plar:IsInGroup(3467972) then
if not debounce then
debounce = true
wait(1)
part.BrickColor = BrickColor.Green()
else
part.BrickColor = BrickColor.Red()
end
debounce = false
end
end
end)

1 comment
No it should not be a local script