0

# My Player.Backpack script isn't working. I dont know why but I am pretty sure I did it right though?

Edited 11 months ago

local Sword = script.Parent local ReplicatedStorage = game:FindService("ReplicatedStorage") local SwordGive = ReplicatedStorage.ClassicSword

Sword.ProximityPrompt.Triggered:Connect(function(player) local SwordCopy = Sword:Clone() SwordCopy.Parent = player.Backpack end)

this is the script and it seems very easy to do but something is wrong with my backpack script or something and i cant figure it out.

0

Where is the script at?

In the function, you copy "Sword" which is the script's Parent, Not "SwordGive" which is the tool in ReplicatedStorage

local Sword = script.Parent
local ReplicatedStorage = game:FindService("ReplicatedStorage")
local SwordGive = ReplicatedStorage.ClassicSword

Sword.ProximityPrompt.Triggered:Connect(function(player)
local SwordCopy = SwordGive:Clone()
SwordCopy.Parent = player.Backpack
end)