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

I have a problem with shop system?

Asked by 4 years ago

So i made a buy script with remote event here the script:

1script.Parent.MouseButton1Click:Connect(function()
2    if script.Parent.Parent.Parent.WhichTier == 1
3    then
4        game.ReplicatedStorage.RemoveClicks:FireServer(4)
5        script.Parent.Text = "Equip"
6        script.Parent.Equip = true
7    end
8end)

And heres the remove server script:

1game.ReplicatedStorage.RemoveClicks.OnServerEvent:Connect(function(Player,Remove)
2    Player.leaderstats.Clicks.Value = Player.leaderstats.Clicks.Value -Remove
3end)

BUT WHEN I CLICK THEN NOTHING! (ALSO THERES NO ERROR IN THE OUTPUT)

(ALSO THIS IS A LOCAL SCRIPT)

0
Is "script.Parent.Parent.Parent.WhichTier" 1? Because if it's not, the if statement will not run, thus it won't fire the event. User#32819 0 — 4y
0
Yeah its is JasiuJasiuB 13 — 4y
0
Why are you sending an argument called 4? Dovydas1118 1495 — 4y
0
cause its the cost JasiuJasiuB 13 — 4y

Answer this question