Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[SOLVED] My in game currency land buying script isn't working?

Hi I'm new around here, started scripting a couple of months ago, have basic knowledge. So in my game that's GUI based I'm trying to implement a shop to make land appear. I've tried tutorials and things to see what I have done wrong but nothing seems to work. Any help would be appreciated. Here's the script:

script.Parent.MouseButton1Click:connect(function()

local price = 250

local player = game.Players.LocalPlayer

local stats = player:WaitForChild("leaderstats")

if stats.Robux.Value >= price then

stats.Robux.Value = stats.Robux.Value - price

script.Parent.Parent.Parent.Parent.Land.Visible = true

end

end)

-- robux is my currency

I'm sure I've done something simple wrong but any help is appreciated.

Edit: The land is GUI based not actual blocks

5 comments

0

May I ask if there are any errors coming up when you try?

0

There are zero errors when I try I have tried many different scripts but none seem to work.

0

This is a LocalScript?

0

This should work if you put it inside a LocalScript.

0

Thanks it works now! Thank you everyone for their help.

1 answer

Solved by other people - It needed to be in a local script.

This discussion is preserved as it was. New answers, comments, and votes are closed.