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

How do i make that GUI Visible? not sure what i did wrong

Asked by 2 years ago

So i have this code right here, what it does is make the next parts appear in the obby. and i want it to be if the player doesnt have above 100, he will get a pop up UI. and i did that at the bottom, and for some reason it just doesnt turn visible (The UI) in game it says its visible but its not shown. i really need help here. this is a script btw not a local script.

local PP = script.Parent.ProximityPrompt
local PPS = game:GetService("ProximityPromptService")
local pad = game.Workspace.Cloud1.Obby1["Obby Start  - 100$"].Head
local OtherPPS = game.Workspace.Cloud1.Obby2["Lava Stripes - 500$"].Head.ProximityPrompt
PP.Triggered:Connect(function(player)
    local Teams = game:GetService("Teams")
    if player.Team == Teams.Red  then
        local OtherPads = {game.Workspace.Cloud1.Obby2["Lava Stripes - 500$"].Head}
        local points1 = player:FindFirstChild("leaderstats") 
        if points1.points.Value >= 100 then
            points1.points.Value = points1.points.Value - 100
            pad:Destroy()

            local nextbutton = game.Workspace.Cloud1.Obby2["Lava Stripes - 500$"].Head
            local Checkpoint = game.Workspace.CheckPoints["1"]
            local Checkpointd = game.Workspace.CheckPoints["1"].Decal

            Checkpoint.Transparency = 0
            Checkpointd.Transparency = 0

            local parts = game.Workspace.Obby1.Jumps:Getchildren()


            for i, v in pairs(parts) do
                v.Transparency = 0
                v.CanCollide = true
                v.CanTouch = true
            end

            OtherPPS.Enabled = true
            for i, v in pairs(OtherPads) do
                v.Transparency = 0
                v.CanCollide = true
                v.CanTouch = true
            end

            nextbutton.Transparency = 0
        else
            local NotE = game.StarterGui.ScreenGui.Frame1
            NotE.Visible = true
        end
    end


end)

1 answer

Log in to vote
0
Answered by
imKirda 4491 Moderation Voter Community Moderator
2 years ago
Edited 2 years ago
local NotE = game.StarterGui.ScreenGui.Frame1

You are modifying GUI in StarterGui, this GUI is cloned into players when they spawn, you need to modify PlayerGui which is GUI of the specific player, in your code replace the line with:

local NotE = player.PlayerGui.ScreenGui.Frame1

You should not handle GUI on the server, instead use RemoteEvents, though in your case it's just one line and it should not matter but it does not change the fact that it's a bad practice. Read more about PlayerGui here.

Ad

Answer this question