Where do I put this clear backpack script within this script?
Soooooo, I found a free round Intermission/Round system here's the script
02 | local m_bIncrementLocations = true |
04 | local m_bTeleportAll = true |
06 | local m_iTimerLength = 10 |
08 | local m_iBreakTime = 10 |
11 | ActiveRound = Model.ActiveRound |
12 | RoundTime = Model.RoundTime |
13 | IntTime = Model.IntermissionTimeLeft |
15 | IntTime.Value = m_iBreakTime |
17 | function m_fnHandleTimer() |
18 | if (ActiveRound.Value and RoundTime.Value > 0 ) then |
19 | RoundTime.Value = RoundTime.Value - 1 |
21 | if (ActiveRound.Value and RoundTime.Value < = 0 ) then |
23 | Model.IntermissionTimeLeft.Value = m_iBreakTime |
24 | ActiveRound.Value = false |
25 | for i, player in ipairs (game.Players:GetChildren()) do |
26 | max = Model.LobbyBricks:GetChildren() |
27 | randomlocation = math.random( 1 ,#max) |
28 | m_fnTeleportTo(max [ randomlocation ] , player, i) |
33 | ActiveRound.Changed:connect( function (NewValue) |
34 | if (ActiveRound.Value = = false ) then |
35 | while (Model.IntermissionTimeLeft.Value > 0 ) do |
37 | Model.IntermissionTimeLeft.Value = Model.IntermissionTimeLeft.Value - 1 |
39 | RoundTime.Value = m_iTimerLength |
40 | ActiveRound.Value = true |
41 | Model.IntermissionTimeLeft.Value = 0 |
42 | for i, player in ipairs (game.Players:GetChildren()) do |
43 | max = Model.GameBricks:GetChildren() |
44 | randomlocation = math.random( 1 ,#max) |
45 | m_fnTeleportTo(max [ randomlocation ] , player, i) |
50 | function m_fnTeleportTo(Part, player, i) |
51 | if player.Character and player.Character:FindFirstChild( "HumanoidRootPart" ) then |
52 | if (m_bIncrementLocations = = true ) then |
53 | player.Character.HumanoidRootPart.CFrame = Part.CFrame + Vector 3. new( 0 , i * 5 , 0 ) |
55 | player.Character.HumanoidRootPart.CFrame = Part.CFrame |
60 | function m_fnHandleActiveGame() |
61 | if (ActiveRound.Value = = true and RoundTime.Value = = m_iTimerLength) then |
62 | for i, player in ipairs (game.Players:GetChildren()) do |
63 | max = Model.GameBricks:GetChildren() |
64 | randomlocation = math.random( 1 ,#max) |
65 | m_fnTeleportTo(max [ randomlocation ] , player, i) |
74 | m_fnHandleActiveGame() |
Don't Get anxious This script is quite simple and what I wanna do is simpler Soo
how do I get that Once every round ends that's this script will run
1 | script.Parent.MouseButton 1 Click:Connect( function () |
3 | LocalPlayer.Backpack:ClearAllChildren() |
4 | local toolInCharacter = LocalPlayer.Character:FindFirstChildWhichIsA( "Tool" ) |
5 | if toolInCharacter then |
6 | toolInCharacter:Destroy() |
Its a simple script That I made that clears the player backpack
so How do I make so that it clears everybody's inventory system before teleporting to the lobby???