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

SHOP Gui not detecting click or giving stats!?

Asked by 5 years ago

So I have a shop gui and it wont work I used a regular script it wont say I clicked.If I used a local script it will work only for the client.Plz help

Script:

script.Parent.MouseButton1Click:Connect(function()
    print("yes")
    local player = script.Parent.Parent.Parent.Parent.Parent
    local stats = player:WaitForChild("leaderstats")
    local popularity = stats:WaitForChild("Popularity")
    local boost = stats:WaitForChild("Boost")
    if popularity and boost then
        print("good")
        if popularity.Value >= 25 then
            popularity.Value = popularity.Value - 25
            boost.Value = boost.Value + 1
        end
    end
end)
0
Making this a local script and using a Remote Event would work. You may also change local player == script.Parent.Parent.. and so on - to game.Players.LocalPlayer GoodCallMrOlsen 70 — 5y
0
iTS A script MahadTheIronSword 98 — 5y
0
not a local script MahadTheIronSword 98 — 5y
0
handle the mousebutton1click in a local script and a fire a remote event to the server to handle changing the popularity and boost values Gey4Jesus69 2705 — 5y
0
you can not use a Script in GUI's only if you replicate GUI from server yHasteeD 1819 — 5y

Answer this question