Player=script.Parent.Parent.Parent.Parent.Parent
script.Parent.Text=tostring(script.Parent.ItemName.Value)..": "..tonumber(script.Parent.Cost.Value).." "..tostring(script.Parent.Currency.Value)
script.Parent.MouseButton1Click:connect(function()
if Player:findFirstChild("leaderstats") then
if Player.leaderstats[script.Parent.Currency.Value].Value>=tonumber(script.Parent.Cost.Value) then
Player.leaderstats[script.Parent.Currency.Value].Value=Player.leaderstats[script.Parent.Currency.Value].Value-tonumber(script.Parent.Cost.Value)
game.Lighting[script.Parent.ItemName.Value]:Clone().Parent=Player.Backpack
game.Lighting[script.Parent.ItemName.Value]:Clone().Parent=Player.StarterGear
end
end
end)
Here's the code in each Item button, I know there aren't any typos with the number/string values and the gear is in lighting where it needs to be. Any ideas guys? Thanks in advance, I'll probably be headed to bed after this.
If you'd like to reach out to me through discord I'd be really grateful, I've got my details on my profile. (You're welcome to stop in just to chat, too.) Stuff in my workspace is set up like this, I don't think there are any problems here but just incase.
Sidenote : My close button also doesn't work, which also confuses me (I'm more concerned with the first issue though.)
print("Close button loaded")
button = script.Parent
window = script.Parent.Parent
function onClicked(GUI)
window:remove()
end
script.Parent.MouseButton1Click:connect(onClicked)

2 comments
That last example is a free model.
Yeah, I used it since I don't really know what I'm doing. The whole project is something I followed from a youtube video. I just want things to work, man :(