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

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

Asked by 3 years ago

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

Log in to vote
0
Answered by 3 years ago
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!

Ad

Answer this question