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

Making a shop gui and none of my scripts work except for the close button?

function onClicked()
	if game.Players.LocalPlayer.leaderstats.Euros >= 50 then
		game.Lightning.FakePassport:Clone().Parent = game.Players.LocalPlayer.Backpack

else
	script.Parent.Text = "Not enough currency"
	wait(1)
	script.Parent.Text = "Buy Fake Passport - €50"
	end
end

script.Parent.MouseButton1Click:connect(onClicked)

This script wont work and doesnt even change the text to "not enough currency"

1 comment

0

Where you put 'script.Parent.Text', Pretty sure that should be 'script.Parent.Text.Text' This is because you want to change the text value and not the 'name' of the text.

1 answer

✓ Accepted answer
if game.Players.LocalPlayer.leaderstats.Euros >= 50 then

You forgot to put Euros.Value at the end of this line. Hope this helps!

Your new script should look something like this:

function onClicked()
    if game.Players.LocalPlayer.leaderstats.Euros.Value >= 50 then--Changed to ".Value"
        game.Lightning.FakePassport:Clone().Parent = game.Players.LocalPlayer.Backpack

else
    script.Parent.Text = "Not enough currency"
    wait(1)
    script.Parent.Text = "Buy Fake Passport - €50"
    end
end

script.Parent.MouseButton1Click:connect(onClicked)

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