Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 2 years ago
Edited 2 years 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.

1 answer

Log in to vote
0
Answered by 2 years ago

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)
Ad

Answer this question