When you open the console, are there any errors?
Nope, not that i see. Idky it just doesnt start
When the player enters the ring, add a print(Occupants)
to see how many occupants the script thinks there are. The reason why the game isnât starting is probably because the occupants value isnât 2.
Where in the could should I add the print?
Try putting it after this line here: Occupants = Occupants + 1
Over here, I think that this is holding up the thread.
if Occupants == 2 then
coroutine.wrap(function()
wait(1)
Billboard.Enabled = false
end)()
Try this instead:
if Occupants == 2 then
spawn(function()
wait(1)
Billboard.Enabled = false
end)
Sorry where is that in the code? I dont see it and I did ctrl F and couldnt find it
Itâs in the event that detects when a player enters the ring, inside the main ring script.
I like legit dont have it where should I add that little script then?
under what line (thats probably y its not working lol)
You really donât have that part? Itâs right under this line: if Occupants == 2 then
Yeah look, unless it was removed somewhere in the code you sent. https://gyazo.com/5a3e9cdd337aac74fafcfbaa1103eb45
I looked at it, and thereâs a part that disappeared:
PP.Triggered:Connect(function(Player)
local Found = false
for i, v in pairs(Corners) do
if v.Occupant.Value == Player.Character then
Found = true
end
end
if Found then return end
Player.PlayerGui.ShadowBoxing.LeaveMatch.Visible = true
Occupants = Occupants + 1
local Corner = Corners[1]
if Corner.Occupant.Value ~= nil then
Corner = Corners[2]
end
Corner.Occupant.Value = Player.Character
Player.Backpack.Data.Ring.Value = script.Parent
Billboard.TextLabel.Text = Occupants.. "/2"
-- This will fire only once.
Player.Character.Humanoid.Died:Once(function()
-- Check if the player is still the occupant.
if Corner.Occupant.Value == Player.Character then
Corner.Occupant.Value = nil
Player.PlayerGui.ShadowBoxing.LeaveMatch.Visible = false -- Hide the button when the player dies.
end
end)
-- This is the missing part.
if Occupants == 2 then
coroutine.wrap(function()
wait(1)
Billboard.Enabled = false
end)()
PP.Enabled = false
local RandomNumber = math.random(1,2)
Attacker.Value = Corners[RandomNumber].Occupant.Value
Defender.Value = Corners[((RandomNumber == 1) and 2) or 1].Occupant.Value
game.ReplicatedStorage.Client.Countdown:FireClient(game.Players:GetPlayerFromCharacter(Attacker.Value))
game.ReplicatedStorage.Client.Countdown:FireClient(game.Players:GetPlayerFromCharacter(Defender.Value))
wait(3)
StartFight()
PP.Enabled = true
Billboard.Enabled = true
end
end)
At the end of the StartFight()
function, there is an Occupants = 0
line somewhere. That needs to be moved to the very end of the function, after setting all the corners to nil.
Works like a charm! One thing the guy did not understand is when the attacker had 1 move right then lost the next, the animation would only play one instead of twice. Is there a way to fix that?
Ex Getting it Wrong: https://gyazo.com/46b289f448c88b43c70db6e812ed2a1f
Ex Getting it Right: https://gyazo.com/6a5c8a6d05c396924cf211080e073e35
See how I had the first one right, but when i got the second one wrong it didnt play the first animation i got right? How could I do that. Its hard to explain so lmk if you dont get it
I have some idea what youâre supposed to do. Lemme figure it out first.
I think I know what you mean now.
One second ill find a good example.
See how when I chose right and I got it wrong so I had to go again. Then I chose up and I got it right (I was defending). Since i had to choose a second time, the first animation played, then the second one. Thats how I want it. For the system I have, if I choose it wrong the first time, then right the second time, it only plays one time. https://gyazo.com/46b289f448c88b43c70db6e812ed2a1f