|
| 28 Dec 2015 01:49 PM |
how do i make a spectate gui
|
|
|
| Report Abuse |
|
|
|
| 28 Dec 2015 01:50 PM |
Every time you click the left or right button a value goes up or down.
The player your spectating is game.players[value], then you go from there :). |
|
|
| Report Abuse |
|
|
| |
|
|
| 28 Dec 2015 01:53 PM |
This is how I make my spectate gui: (matchtag is too make sure their in the game round).
leftbutton.MouseButton1Down:connect(function() tag.Value = tag.Value - 1 if tag.Value <= 0 then tag.Value = #game.Players:GetChildren() end end) rightbutton.MouseButton1Down:connect(function() tag.Value = tag.Value + 1 if tag.Value > #game.Players:GetChildren() then tag.Value = 0 end end)
function spectate() local players = game.Players:GetChildren() if players then local player = players[tag.Value] if player then if player.Character:FindFirstChild("MatchTag") ~= nil then local character = player.Character local humanoid = character:WaitForChild("Humanoid") if humanoid then cam.CameraSubject = humanoid name.Text = player.Name end else return spectate() end end end end tag.Changed:connect(spectate)
|
|
|
| Report Abuse |
|
|