|
| 21 Jul 2014 01:23 PM |
I have a Terminal at my Fort, and it has a working timer and capture. What it doesn't have is a script that will deactivate it if the raid is not official. To have an official raid there has to be at least 4 Members on a certain team. Can anyone help me with this? Here is the Main script.
timeuntilwin = 900 totaltime = 900
raidteamcolor = "Really black" defendteamcolor = "CGA brown" h = Instance.new("Hint")
function OnTouched(hit)
if hit.Parent:findFirstChild("Humanoid") ~= nil then if game.Players:GetPlayerFromCharacter(hit.Parent).TeamColor == BrickColor.new(raidteamcolor) then script.Parent.BrickColor = BrickColor.new(raidteamcolor) 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 = "The Hostiles will win in".." "..timeuntilwin
if timeuntilwin <= totaltime and timeuntilwin > 0 then wait(1) timeuntilwin = timeuntilwin - 1 end
if timeuntilwin == 0 then h:remove()
winmsg = Instance.new("Message") winmsg.Parent = game.Workspace winmsg.Text = "The Hostiles have won." wait(5) winmsg:remove()
script.Parent.BrickColor = BrickColor.new(defendteamcolor) timeuntilwin = totaltime end end end |
|
|
| Report Abuse |
|
sbk28
|
  |
| Joined: 15 Nov 2008 |
| Total Posts: 2528 |
|
|
| 21 Jul 2014 01:25 PM |
http://wiki.roblox.com/index.php?title=PlayerAdded_(Event) http://wiki.roblox.com/index.php?title=PlayerRemoving_(Event) http://wiki.roblox.com/index.php?title=IsInGroup_(Method) http://wiki.roblox.com/index.php?title=If_statement |
|
|
| Report Abuse |
|