So I have got code already, which buys a part. But I want to introduce tables, so I've added a table. But I now need a listening function for everything in a model, so I can replace workspace.dropTwoBuy. Any ideas?
Prices = {5}
Buyables = {game.ServerStorage.Giver2}
workspace.dropTwoBuy.Head.Touched:connect(function(x)
if x.Parent.Name == owner and game.Players[owner].leaderstats.Points.Value == 5 then
y = game.ServerStorage.Giver2:Clone()
y.Parent = workspace
wait(1)
workspace.dropTwoBuy:Destroy()
end
end)

1 comment
There's an 'edit' button you can use for that.