generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Official Raid Scripting

Previous Thread :: Next Thread 
manofthesnakes is not online. manofthesnakes
Joined: 17 Aug 2010
Total Posts: 94
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image