Ok so I own a group and right now I have been remaking all of my current system to be a more integrated system that is easy for developers to read and I recently deleted the old Gun shop Gui and replaced it with a surface gui but the problem is no errors in the dev console but it's not working. Below you can see the code I hope someone can help me to understand where I went wrong and what I can do to fix this and improve my scripting skills.

player = game.Players.LocalPlayer
glock = game.Lighting.GunstoreWeapons.Glock

script.Parent.MouseButton1Down:connect(function()
	if player.Money.Value >= 250 then
		player.Money.Value = player.Money.Value - 250
	local a = glock:clone()
    a.Parent = player.Backpack
	else 
		script.Parent.Text = "Need more Money!"
		wait(2)
		script.Parent.Text = "Click to buy gun"
	end
end)

Thanks for taking the time to read this and help me improve while fixing my script.

3 comments

0

Please tell it more specific. What happened after you execute this script? Any red lines in Output?

1

I suppose you put the surfaceGUI into a part, instead of in the StarterGui with the Adornee set to the part you want it on.

0

@rubenkan Yes I put it into a part not the startergui.