if moneyAmount.Value >= script.Parent.Cost.Value then
moneyAmount.Value = moneyAmount.Value - script.Parent.Cost.Value
player.Refund.Value = player.Refund.Value + script.Parent.Cost.Value
for i, child in ipairs(script.Parent.Target.Value:GetChildren()) do
if child.ClassName == "Part" or child:IsA("BasePart") then
child.Transparency = 0
if child.Name ~= 'DropLocation' then
child.CanCollide = true
end
end
end
script.Parent.Target.Value.Parent = player.Backpack
There’s more code, but that’s the only code that directly relates to this issue. I’m getting no errors in the output.
Hope you all are enjoying your day,
—@Mithrandir6440
First off, just delete all this, you don’t need it.
All that stuff would be for a stationary object in the workspace, not something going into the player’s backpack
Next put the staff in serverStorage.
Then just say
local staffClone = game.ServerStorage.Staff:Clone() --not sure the name of the staff
staffClone.Parent = player.Backpack
Also try printing the player, the staff’s parent, and a print line at the end of all the code you put in the condition, because if that doesn’t print, then you can start working backwards until you locate the problem, if that makes sense…
Alright. I’m resolving never again to post on the devforum without trying really hard first, because its unfair to all of the people that help me and then I end up solving it by myself.
The issue was that the tool wasn’t in a tool format, it was in a model. Thanks to all who helped on this.