I was wondering if this script would work for a shop GUI it will check if you have the required stats(In this case checking weather you bought or not since this is using datastore I used Intvalues.) So i was wondering what I need to change to give me the item
local tool = ("tool")
function clicked(player)
local stats = player:FindFirstChild("Towers")
local sp = stats:FindFirstChild("Towers")
if sp == nil then return false end
if (sp.Value >= 1) then
tool:clone().parent = player.backpack
end
end
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function()
clicked(player)
end)
end)

3 comments
Wait what do I put in tools it wont let me change it I have more than 1 tool and this script is a little confusing to understand
put a tool in replicatedstorage and name it "Tool" also put a remotevent in replicatedstorage and name that "toolevent"
Good job but next time explain more about RemoteEvents, we can't just code their script for themselves, we have to provide a little bit more information on how RemoteEvents work, but you did really good. + 1