I would like a random tool that you get when the game starts.
Script inside of text label
text = script.Parent.TextLabel
function Intermition()
local Lobby = game.Workspace.Lobby
print("Intermition")
for i = 10, 0, -1 do
text.Text = "INTERMISION ".. i
wait(1)
print("i = "..i)
end
for o = 10, 0, -1 do
text.Text = "GAME STARTING IN " .. o
Lobby.Parent = game.ReplicatedStorage
wait(1)
end
Lobby.Parent = game.Workspace
local wepon = math.random(1, 4)
if wepon == 1 then-----------------------------------Not working
game.ReplicatedStorage.ToolEvents.GunEvent:FireServer()
Start()
end
if wepon == 2 then
game.ReplicatedStorage.ToolEvents.SlingShotEvent:FireServer()
Start()
end
if wepon == 3 then
game.ReplicatedStorage.ToolEvents.KnifeEvent:FireServer()
Start()
end
if wepon == 4 then
game.ReplicatedStorage.ToolEvents.Sword:FireServer()---Up to here
Start()
end
end
function Start()
print("Start")
for n = 60, 0, -1 do
text.Text = "TIME LEFT ".. n
wait(1)
print("n = "..n)
if n == 0 then
Intermition()
end
end
end
Intermition()
This is a script is serverscriptservice
while true do
game.ReplicatedStorage.ToolEvents.GunEvent.OnServerEvent:Connect(function(player)
game.ServerStorage.Tools.Handgun.clone().parent = player.Backpack
end)
game.ReplicatedStorage.ToolEvents.SlingShotEvent.OnServerEvent:Connect(function(player)
game.ServerStorage.Tools.ClassicSlingshot.clone().parent = player.Backpack
end)
game.ReplicatedStorage.ToolEvents.Sword.OnServerEvent:Connect(function(player)
game.ServerStorage.Tools.ClassicSword.clone().parent = player.Backpack
end)
game.ReplicatedStorage.ToolEvents.KnifeEvent.OnServerEvent:Connect(function(player)
game.ServerStorage.Tools.Blade.clone().parent = player.Backpack
end)
end
Thak you for reading this