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

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

Asked by
Galicate 106
6 years ago
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"

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. xEiffel 280 — 6y

1 answer

Log in to vote
0
Answered by
Nikkulaos 229 Moderation Voter
6 years ago
Edited 6 years ago
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)
Ad

Answer this question