Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Purple = {Vector3.new(-1224.6, 385, -1267.617)}
- Green = {Vector3.new(-1143.291, 385, -1205.318)}
- Blue = {Vector3.new(-1298.2, 385, -1262.216)}
- Orange = {Vector3.new(-1203.8, 385, -1227.616)}
- Red = {Vector3.new(-1114.795, 387, -1265.613)}
- print("DID IT INVOKE? - FROM SERVER")
- script.K1.OnServerInvoke = function(player)
- if game.ReplicatedStorage.Kingdom.Kingdoms:FindFirstChild("GreenKingdom") then
- local Owner = game.ReplicatedStorage.Kingdom.Kingdoms:FindFirstChild("GreenKingdom").Owner
- for i,v in pairs (game.Players:GetChildren()) do
- wait(1)
- print("Done getting children")
- if v.Name == Owner.Value then
- print("Got owner")
- v.PlayerGui:FindFirstChild("JoinAcceptDecline")
- v.PlayerGui.JoinAcceptDecline.Join.Visible = true
- v.PlayerGui.JoinAcceptDecline.Join.Player.Text = player.Name.." wants to join your kingdom!"
- print("Owner has gui now")
- repeat
- local onAccept = function()
- player.TeamColor = BrickColor.new("Bright violet")
- player.PlayerGui.MainFramework.Framework.Visible = false
- player.PlayerGui.Menu.Open.Visible = true
- game.ReplicatedStorage.Kingdom.PlayersColor.Purple.Value = game.ReplicatedStorage.Kingdom.PlayersColor.Purple.Value + 1
- v.PlayerGui.JoinAcceptDecline.Join.Visible = false
- player.Character.Torso.CFrame = CFrame.new(Purple[math.random(1,#Purple)])
- return true
- end
- local onDecline = function()
- v.PlayerGui.JoinAcceptDecline.Join.Visible = false
- player.PlayerGui.MainFramework.Framework.JoinKingdomFrame.Waiting.Text = "THE LEADER HAS DECLINED"
- wait(2)
- player.PlayerGui.MainFramework.Framework.JoinKingdomFrame.Waiting.Visible = false
- player.PlayerGui.MainFramework.Framework.JoinKingdomFrame.K1.Visible = true
- player.PlayerGui.MainFramework.Framework.JoinKingdomFrame.K2.Visible = true
- player.PlayerGui.MainFramework.Framework.JoinKingdomFrame.K3.Visible = true
- player.PlayerGui.MainFramework.Framework.JoinKingdomFrame.K4.Visible = true
- player.PlayerGui.MainFramework.Framework.JoinKingdomFrame.K5.Visible = true
- player.PlayerGui.MainFramework.Framework.JoinKingdomFrame.Waiting.Text = "WAITING FOR LEADER TO DECIDE"
- return true
- end
- v.PlayerGui.JoinAcceptDecline.Join.Accept.MouseButton1Click:connect(onAccept)
- v.PlayerGui.JoinAcceptDecline.Join.Decline.MouseButton1Click:connect(onDecline)
- until onAccept == true or onDecline == true
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement