Output says
16:12:49.309 - Attempt to connect failed: Passed value is not a function
16:12:49.310 - Script 'Workspace.Test.Touch.Script', Line 60
16:12:49.310 - Stack End
16:12:49.828 - attempt to call a nil value
16:12:49.829 - Disconnected event because of exception
timeuntilwin = 10
totaltime = 10
raidteamcolor = "Bright red"
defendteamcolor = "Bright blue"
n= "Mid gray"
h = Instance.new("Hint")
function Touched(hit)
if hit.Parent:findFirstChild("Humanoid") ~= nil then
if game.Players:GetPlayerFromCharacter(hit.Parent).TeamColor == BrickColor.new("raidteamcolor") then
if game.Players:GetPlayerFromCharacter(hit.Parent).Backpack.Bomb ~= nil then
script["TermOwner"].Value = BrickColor.new("Bright red")
end
if game.Players:GetPlayerFromCharacter(hit.Parent).TeamColor == BrickColor.new(defendteamcolor) then
script.Parent.BrickColor = BrickColor.new(defendteamcolor)
timeuntilwin = totaltime
for i, v in pairs(game.Workspace:GetChildren()) do
if v:IsA("Hint") then
v:remove()
end
end
end
end
end
script.Parent.Touched:connect(OnTouched)
while true do
wait()
if script.Parent.BrickColor == BrickColor.new(raidteamcolor) then
h.Parent = game.Workspace
h.Text = "Forcefield destroyed in".." "..timeuntilwin
if timeuntilwin 0 then
wait(1)
timeuntilwin = timeuntilwin - 1
end
if timeuntilwin == 0 then
h:remove()
winmsg = Instance.new("Hint")
winmsg.Parent = game.Workspace
winmsg.Text = "Raiders have destroyed the force field!"
script.Parent.ForceField.Transparency = 1
script.Parent.ForceField.CanCollide = false
wait(10)
winmsg:remove()
script.Parent.BrickColor = BrickColor.new(n)
timeuntilwin = totaltime
end
end
end
end
script.Parent.Touched:connect(OnTouched)
Caaaactus. |