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

Surface Gui Shop?

Asked by
faruque 30
10 years ago

Can anyone tell me what wrong with this script.

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.MouseButtom1Click: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)

The script is inside a Textbuttom which is inside a frame which is inside a SurfaceGui

2 answers

Log in to vote
0
Answered by
ipiano 120
10 years ago

You misspelled MouseButton1Click() in line 3

Ad
Log in to vote
0
Answered by 10 years ago

Look at your Script Output. Is it generating any errors? If so, then what are they?

0
It came up with a error saying " MouseButtom1Click is not a valid member of TextButton" faruque 30 — 10y
0
Can anyone help me fix this problem? faruque 30 — 10y

Answer this question