Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I Fix This Backpack Problem? No Errors Show Up In Console

So I've been working on this for about 3 hours now. I'm trying to clone a sword from ReplicatedStorage to the player's Backpack through a server script. No errors or anything show up when I execute the code, it just does nothing.

local supersword2 = game.ReplicatedStorage.ClassicSword for _,v in pairs{game.Players:GetPlayerFromCharacter(script.Parent)} do supersword2:Clone().Parent = v.Backpack end end;

1 answer

Why are you using an in pairs() loop?

local supersword2 = game.ReplicatedStorage.ClassicSword 
local player = game.Players:GetPlayerFromCharacter(script.Parent)
local clonedSword = supersword2:Clone()
clonedSword.Parent = player.Backpack

1 comment

0

The player returned nil when I used that script, is there something I'm missing?

This discussion is preserved as it was. New answers, comments, and votes are closed.