Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local States = {"Central Powers", "Allies", "International White"}
- local isCapped = false
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local RemoteEvent = game.ReplicatedStorage.Capture
- local Cooldown = false
- local teamCapped = States[3]
- local announce = game.StarterGui.CaptureAnn.Frame.CaptureAnnouncement
- local color = Color3.new
- local colorsq = ColorSequence.new
- local bc = BrickColor.new
- local wfc = game.WaitForChild
- local flag = script.Parent
- local base = wfc(flag, "Base")
- local pt = wfc(flag, "Particles")
- local c1 =wfc(flag,"Circle")
- local c2 =wfc(flag,"Circle2")
- local c3 =wfc(flag,"Circle3")
- local tm =wfc(flag,"TeamColor")
- local fg =wfc(flag,"Flag")
- local sp =wfc(fg,"Spot")
- local dt =wfc(sp,"A")
- local areaname = script.Parent.areaname.Value
- local cloud = pt.Cloud
- local flame = pt.Flame
- local light = pt.PointLight
- local text = script.Parent.Flag.Spot.A
- local function updateColor()
- if teamCapped == States[3] then
- cloud.Color = colorsq(color(1,1,1),color(0,0,0))
- flame.Color = colorsq(color(1,1,1),color(1,1,1))
- light.Color = color(1,1,1)
- dt.BackgroundColor3 = color(1,1,1)
- c1.BrickColor = bc("White")
- c2.BrickColor = bc("White")
- c3.BrickColor = bc("White")
- text.TextColor3 = Color3.fromRGB(255,255,255)
- else
- cloud.Color = colorsq(tm.Value.Color,color(0,0,0))
- flame.Color = colorsq(tm.Value.Color,color(1,1,1))
- light.Color = tm.Value.Color
- dt.BackgroundColor3 = tm.Value.Color
- c1.BrickColor = tm.Value
- c2.BrickColor = tm.Value
- c3.BrickColor = tm.Value
- end
- end
- updateColor()
- local touch = script.Parent.touch
- touch.Touched:Connect(function(hit)
- if hit.Parent:FindFirstChild("Humanoid") then
- if not Cooldown then
- Cooldown = true
- local team = game.Players:GetPlayerFromCharacter(hit.Parent).Team.Name
- if team == teamCapped then
- Cooldown = false
- return
- else
- if team == States[1] then
- print('CP')
- game.Workspace.Whistle:Play()
- script.Parent.cloth.BrickColor = BrickColor.new("Dark stone grey")
- for i = 1, 10 do
- wait(1)
- teamCapped = States[1]
- tm.Value = bc("Bright green")
- text.TextColor3 = Color3.fromRGB(0,155,0)
- updateColor()
- wait(1)
- teamCapped = States[3]
- tm.Value = bc("International White")
- updateColor()
- end
- teamCapped = States[1]
- tm.Value = bc("Bright green")
- game.Workspace.Whistle_Captured:Play()
- script.Parent.cloth.flagcp1.Transparency = 0.8
- script.Parent.cloth.flagcp2.Transparency = 0.8
- text.TextColor3 = Color3.fromRGB(0,155,0)
- updateColor()
- elseif team == States[2] then
- print('allies')
- game.Workspace.Whistle:Play()
- script.Parent.cloth.BrickColor = BrickColor.new("Bright blue")
- for i = 1, 10 do
- wait(1)
- teamCapped = States[2]
- tm.Value = bc("Bright blue")
- text.TextColor3 = Color3.fromRGB(0,85,255)
- updateColor()
- wait(1)
- teamCapped = States[3]
- tm.Value = bc("International White")
- updateColor()
- end
- teamCapped = States[2]
- tm.Value = bc("Bright blue")
- game.Workspace.Whistle_Captured:Play()
- RemoteEvent:FireAllClients()
- script.Parent.cloth.flaguk1.Transparency = 0.8
- script.Parent.cloth.flaguk2.Transparency = 0.8
- text.TextColor3 = Color3.fromRGB(0,85,255)
- updateColor()
- end
- Cooldown = false
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement