So, I wrote a script to randomly pick a player (This seems to work fine, and it even prints the players name and prints it correctly) The issue is when the player is supposed to receive the sword. When this comes around, the sword is never given and I don't receive any error either and its in a normal script.
if match == 1 then
wait(5)
local picker = math.random(3)
event = events[picker]
print(event)
text.Text = event
if picker == 1 then
local players = game.Players:GetPlayers()
local nplrs = #players
local Randomplayer = nil
if nplrs > 0 then
Randomplayer = players[math.random(1, nplrs)]
end
print(Randomplayer)
local Clonetool = game.ReplicatedStorage.ClassicSword:Clone().Parent
Clonetool = Randomplayer.Backpack

1 comment
print(Randomplayer) should be print(Randomplayer.Name) it might error