I have 2 swords that you can be given and I am using math.random to produce a number between 1 and 2. the game debugs and shows me it gets 2 but you get nothing. If It is 1 however you get something what did I do wrong?
game.ReplicatedStorage.CloneTool.OnServerEvent:Connect(function(player)
local number = math.random(1,2)
print(number)
if number == 1 then
local Tool = game.ServerStorage.ClassicSword
local Part = script.Parent
local Clone = Tool:Clone()
Clone.Parent = player.Character
if number == 2 then
local Tool = game.ServerStorage.Sword
local Part = script.Parent
local Clone = Tool:Clone()
Clone.Parent = player.Character
end
end
end)

1 comment
you might want to put an "end" before your 2nd "if" statement.