Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Gui to Lua
- -- Version: 3.1
- -- Instances:
- local TeenTitansGOJumpJoustsGUI = Instance.new("ScreenGui")
- local CPUHealthFrame = Instance.new("Frame")
- local HealthBar = Instance.new("Frame")
- local ImageLabel = Instance.new("ImageLabel")
- local Name = Instance.new("TextLabel")
- local Plr1 = Instance.new("Frame")
- local ImageLabel_2 = Instance.new("ImageLabel")
- local P1Wins = Instance.new("TextLabel")
- local LeaderboardText = Instance.new("TextLabel")
- local CPUWins = Instance.new("TextLabel")
- local LeaderboardText_2 = Instance.new("TextLabel")
- local CPU = Instance.new("Frame")
- local ImageLabel_3 = Instance.new("ImageLabel")
- local HealthFrame = Instance.new("Frame")
- local HealthBar_2 = Instance.new("Frame")
- local ImageLabel_4 = Instance.new("ImageLabel")
- local Name_2 = Instance.new("TextLabel")
- --Properties:
- TeenTitansGOJumpJoustsGUI.Name = "Teen Titans GO! Jump Jousts GUI"
- TeenTitansGOJumpJoustsGUI.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- CPUHealthFrame.Name = "CPUHealthFrame"
- CPUHealthFrame.Parent = TeenTitansGOJumpJoustsGUI
- CPUHealthFrame.BackgroundColor3 = Color3.fromRGB(85, 0, 127)
- CPUHealthFrame.BorderColor3 = Color3.fromRGB(85, 0, 127)
- CPUHealthFrame.BorderSizePixel = 0
- CPUHealthFrame.Position = UDim2.new(0.101879053, 0, 0.0802275911, 0)
- CPUHealthFrame.Size = UDim2.new(0, 389, 0, 37)
- HealthBar.Name = "HealthBar"
- HealthBar.Parent = CPUHealthFrame
- HealthBar.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
- HealthBar.BorderSizePixel = 0
- HealthBar.Position = UDim2.new(1.76349616, 0, 0, 0)
- HealthBar.Size = UDim2.new(0, 409, 0, 37)
- ImageLabel.Parent = CPUHealthFrame
- ImageLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- ImageLabel.BackgroundTransparency = 100.000
- ImageLabel.Position = UDim2.new(1.74759114, 0, -0.153295979, 0)
- ImageLabel.Size = UDim2.new(0, 423, 0, 48)
- ImageLabel.Image = "rbxassetid://3421766825"
- Name.Name = "Name"
- Name.Parent = CPUHealthFrame
- Name.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Name.BackgroundTransparency = 1.000
- Name.BorderSizePixel = 0
- Name.Position = UDim2.new(0, 846, 0, -35)
- Name.Size = UDim2.new(0, 208, 0, 29)
- Name.Font = Enum.Font.SourceSans
- Name.Text = "Computer"
- Name.TextColor3 = Color3.fromRGB(255, 0, 255)
- Name.TextScaled = true
- Name.TextSize = 14.000
- Name.TextStrokeColor3 = Color3.fromRGB(255, 0, 0)
- Name.TextStrokeTransparency = 0.000
- Name.TextWrapped = true
- Plr1.Name = "Plr1"
- Plr1.Parent = TeenTitansGOJumpJoustsGUI
- Plr1.BackgroundColor3 = Color3.fromRGB(170, 170, 255)
- Plr1.BorderColor3 = Color3.fromRGB(0, 0, 0)
- Plr1.BorderSizePixel = 3
- Plr1.Position = UDim2.new(0.00746965455, 0, 0.0194003601, 0)
- Plr1.Size = UDim2.new(0, 100, 0, 100)
- ImageLabel_2.Parent = Plr1
- ImageLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- ImageLabel_2.BackgroundTransparency = 1.000
- ImageLabel_2.BorderSizePixel = 0
- ImageLabel_2.Position = UDim2.new(-0.00686279312, 0, 0.0506170653, 0)
- ImageLabel_2.Size = UDim2.new(0, 100, 0, 88)
- ImageLabel_2.ZIndex = 2
- ImageLabel_2.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&userId=1"
- ImageLabel_2.ScaleType = Enum.ScaleType.Crop
- P1Wins.Name = "P1Wins"
- P1Wins.Parent = TeenTitansGOJumpJoustsGUI
- P1Wins.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- P1Wins.BackgroundTransparency = 1.000
- P1Wins.Position = UDim2.new(0.195999995, 0, 0.167673722, 0)
- P1Wins.Size = UDim2.new(0, 71, 0, 34)
- P1Wins.Font = Enum.Font.SourceSans
- P1Wins.Text = "Wins:"
- P1Wins.TextColor3 = Color3.fromRGB(255, 255, 255)
- P1Wins.TextScaled = true
- P1Wins.TextSize = 14.000
- P1Wins.TextStrokeTransparency = 0.100
- P1Wins.TextWrapped = true
- P1Wins.TextXAlignment = Enum.TextXAlignment.Left
- LeaderboardText.Name = "LeaderboardText"
- LeaderboardText.Parent = P1Wins
- LeaderboardText.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- LeaderboardText.BackgroundTransparency = 1.000
- LeaderboardText.Position = UDim2.new(0.914309621, 0, 0.108849913, 0)
- LeaderboardText.Size = UDim2.new(0, 128, 0, 34)
- LeaderboardText.Font = Enum.Font.SourceSans
- LeaderboardText.Text = "?"
- LeaderboardText.TextColor3 = Color3.fromRGB(255, 255, 255)
- LeaderboardText.TextScaled = true
- LeaderboardText.TextSize = 14.000
- LeaderboardText.TextStrokeTransparency = 0.100
- LeaderboardText.TextWrapped = true
- LeaderboardText.TextXAlignment = Enum.TextXAlignment.Left
- CPUWins.Name = "CPUWins"
- CPUWins.Parent = TeenTitansGOJumpJoustsGUI
- CPUWins.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- CPUWins.BackgroundTransparency = 1.000
- CPUWins.Position = UDim2.new(0.824068844, 0, 0.169184297, 0)
- CPUWins.Size = UDim2.new(0, 68, 0, 34)
- CPUWins.Font = Enum.Font.SourceSans
- CPUWins.Text = "Wins:"
- CPUWins.TextColor3 = Color3.fromRGB(255, 255, 255)
- CPUWins.TextScaled = true
- CPUWins.TextSize = 14.000
- CPUWins.TextStrokeTransparency = 0.100
- CPUWins.TextWrapped = true
- CPUWins.TextXAlignment = Enum.TextXAlignment.Right
- LeaderboardText_2.Name = "LeaderboardText"
- LeaderboardText_2.Parent = CPUWins
- LeaderboardText_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- LeaderboardText_2.BackgroundTransparency = 1.000
- LeaderboardText_2.Position = UDim2.new(1.10348153, 0, 0.0515370071, 0)
- LeaderboardText_2.Size = UDim2.new(0, 147, 0, 34)
- LeaderboardText_2.Font = Enum.Font.SourceSans
- LeaderboardText_2.Text = "?"
- LeaderboardText_2.TextColor3 = Color3.fromRGB(255, 255, 255)
- LeaderboardText_2.TextScaled = true
- LeaderboardText_2.TextSize = 14.000
- LeaderboardText_2.TextStrokeTransparency = 0.100
- LeaderboardText_2.TextWrapped = true
- LeaderboardText_2.TextXAlignment = Enum.TextXAlignment.Left
- CPU.Name = "CPU"
- CPU.Parent = TeenTitansGOJumpJoustsGUI
- CPU.BackgroundColor3 = Color3.fromRGB(170, 170, 255)
- CPU.BorderColor3 = Color3.fromRGB(0, 0, 0)
- CPU.BorderSizePixel = 3
- CPU.Position = UDim2.new(0.919621885, 0, 0.0209109373, 0)
- CPU.Size = UDim2.new(0, 100, 0, 100)
- ImageLabel_3.Parent = CPU
- ImageLabel_3.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- ImageLabel_3.Size = UDim2.new(0, 100, 0, 100)
- ImageLabel_3.Image = "rbxassetid://40180982"
- HealthFrame.Name = "HealthFrame"
- HealthFrame.Parent = TeenTitansGOJumpJoustsGUI
- HealthFrame.BackgroundColor3 = Color3.fromRGB(85, 0, 127)
- HealthFrame.BorderColor3 = Color3.fromRGB(85, 0, 127)
- HealthFrame.BorderSizePixel = 0
- HealthFrame.Position = UDim2.new(0.101879053, 0, 0.0802275911, 0)
- HealthFrame.Size = UDim2.new(0, 389, 0, 37)
- HealthBar_2.Name = "HealthBar"
- HealthBar_2.Parent = HealthFrame
- HealthBar_2.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
- HealthBar_2.BorderSizePixel = 0
- HealthBar_2.Position = UDim2.new(-0.00257069408, 0, 0, 0)
- HealthBar_2.Size = UDim2.new(0, 389, 0, 37)
- ImageLabel_4.Parent = HealthFrame
- ImageLabel_4.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- ImageLabel_4.BackgroundTransparency = 100.000
- ImageLabel_4.Position = UDim2.new(-0.0441825353, 0, -0.153295994, 0)
- ImageLabel_4.Size = UDim2.new(0, 423, 0, 48)
- ImageLabel_4.Image = "rbxassetid://3421766825"
- Name_2.Name = "Name"
- Name_2.Parent = HealthFrame
- Name_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Name_2.BackgroundTransparency = 1.000
- Name_2.BorderSizePixel = 0
- Name_2.Position = UDim2.new(0, 60, 0, -36)
- Name_2.Size = UDim2.new(0, 208, 0, 29)
- Name_2.Font = Enum.Font.SourceSans
- Name_2.Text = "Player Name"
- Name_2.TextColor3 = Color3.fromRGB(255, 0, 255)
- Name_2.TextScaled = true
- Name_2.TextSize = 14.000
- Name_2.TextStrokeColor3 = Color3.fromRGB(255, 0, 0)
- Name_2.TextStrokeTransparency = 0.000
- Name_2.TextWrapped = true
- ----------------------------- Leaderboard --------------------------
- print("LinkedLeaderboard script version 5.00 loaded")
- stands = {}
- CTF_mode = false
- function onHumanoidDied(humanoid, player)
- local stats = player:findFirstChild("leaderstats")
- if stats ~= nil then
- local deaths = stats:findFirstChild("WOs")
- deaths.Value = deaths.Value + 1
- -- do short dance to try and find the killer
- local killer = getKillerOfHumanoidIfStillInGame(humanoid)
- handleKillCount(humanoid, player)
- end
- end
- function onPlayerRespawn(property, player)
- -- need to connect to new humanoid
- if property == "Character" and player.Character ~= nil then
- local humanoid = player.Character.Humanoid
- local p = player
- local h = humanoid
- humanoid.Died:connect(function() onHumanoidDied(h, p) end )
- end
- end
- function getKillerOfHumanoidIfStillInGame(humanoid)
- -- returns the player object that killed this humanoid
- -- returns nil if the killer is no longer in the game
- -- check for kill tag on humanoid - may be more than one - todo: deal with this
- local tag = humanoid:findFirstChild("creator")
- -- find player with name on tag
- if tag ~= nil then
- local killer = tag.Value
- if killer.Parent ~= nil then -- killer still in game
- return killer
- end
- end
- return nil
- end
- function handleKillCount(humanoid, player)
- local killer = getKillerOfHumanoidIfStillInGame(humanoid)
- if killer ~= nil then
- local stats = killer:findFirstChild("leaderstats")
- if stats ~= nil then
- local kills = stats:findFirstChild("KOs")
- if killer ~= player then
- kills.Value = kills.Value + 1
- else
- kills.Value = kills.Value - 1
- end
- end
- end
- end
- -----------------------------------------------
- function findAllFlagStands(root)
- local c = root:children()
- for i=1,#c do
- if (c[i].className == "Model" or c[i].className == "Part") then
- findAllFlagStands(c[i])
- end
- if (c[i].className == "FlagStand") then
- table.insert(stands, c[i])
- end
- end
- end
- function hookUpListeners()
- for i=1,#stands do
- stands[i].FlagCaptured:connect(onCaptureScored)
- end
- end
- function onPlayerEntered(newPlayer)
- if CTF_mode == true then
- local stats = Instance.new("IntValue")
- stats.Name = "leaderstats"
- local kills = Instance.new("IntValue")
- kills.Name = "KOs"
- kills.Value = 0
- local deaths = Instance.new("IntValue")
- deaths.Name = "WOs"
- deaths.Value = 0
- local captures = Instance.new("IntValue")
- captures.Name = "Captures"
- captures.Value = 0
- kills.Parent = stats
- deaths.Parent = stats
- captures.Parent = stats
- -- VERY UGLY HACK
- -- Will this leak threads?
- -- Is the problem even what I think it is (player arrived before character)?
- while true do
- if newPlayer.Character ~= nil then break end
- wait(5)
- end
- local humanoid = newPlayer.Character.Humanoid
- humanoid.Died:connect(function() onHumanoidDied(humanoid, newPlayer) end )
- -- start to listen for new humanoid
- newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end )
- stats.Parent = newPlayer
- else
- local stats = Instance.new("IntValue")
- stats.Name = "leaderstats"
- local kills = Instance.new("IntValue")
- kills.Name = "KOs"
- kills.Value = 0
- local deaths = Instance.new("IntValue")
- deaths.Name = "WOs"
- deaths.Value = 0
- kills.Parent = stats
- deaths.Parent = stats
- -- VERY UGLY HACK
- -- Will this leak threads?
- -- Is the problem even what I think it is (player arrived before character)?
- while true do
- if newPlayer.Character ~= nil then break end
- wait(5)
- end
- local humanoid = newPlayer.Character.Humanoid
- humanoid.Died:connect(function() onHumanoidDied(humanoid, newPlayer) end )
- -- start to listen for new humanoid
- newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end )
- stats.Parent = newPlayer
- end
- end
- function onCaptureScored(player)
- local ls = player:findFirstChild("leaderstats")
- if ls == nil then return end
- local caps = ls:findFirstChild("Captures")
- if caps == nil then return end
- caps.Value = caps.Value + 1
- end
- findAllFlagStands(game.Workspace)
- hookUpListeners()
- if (#stands > 0) then CTF_mode = true end
- game.Players.ChildAdded:connect(onPlayerEntered)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement