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

i need help at my tool gui shop it takes the money but it didnt give me the tool?

21:49:35.048 parent is not a valid member of Tool "Sword" - Server - Script:4

game.ReplicatedStorage.Toolevents.Swordevent.OnServerEvent:Connect(function(player) if player.leaderstats.Cash.Value >=10 then player.leaderstats.Cash.Value = player.leaderstats.Cash.Value - 10 (here is the problem --->) game.ServerStorage.Tools.Sword:Clone().parent = player.Backpack end end

1 answer

game.ReplicatedStorage.Toolevents.Swordevent.OnServerEvent:Connect(function(player)
if player.leaderstats.Cash.Value >= 10 then
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value - 10

local sword = game.ServerStorage.Tools.Sword:Clone()
sword.Parent = player.Backpack
end
end)

That should work, if it doesn't, please let me know!

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