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

Not placing the GUI into the player?, no Errors

Asked by 6 years ago
Edited 6 years ago

This is a regular script and I'm trying to make it place this GUI inside of the player once this function is ran. I have the function setup but this line of code is not working. http://prntscr.com/gcdgh9

script.Parent.Notifications:Clone().Parent = game.Players.player.PlayerGui

whole script is this

function Countdown(player)
    if script.Parent.Time.Value <= 60 then
        wait(1)
        script.Parent.Time.Value = script.Parent.Time.Value -1
        script.Parent.Text = "Time Remaining: "..script.Parent.Time.Value.." Seconds"
        if script.Parent.Time.Value == 0 then
            wait(0)
            if game.Workspace.Settings.Mines.Value == true then
                game.Workspace.Settings.Mines.Value = false
                script.Parent.Notifications.Frame.TextLabel.Text = "MINES ARE OPEN"
                script.Parent.Notifications.Frame.TextLabel.TextColor3 = Color3.new(85, 255, 0)
                script.Parent.Notifications:Clone().Parent = game.Players.player.PlayerGui
                game.Workspace.MinerGates.CanCollide.Value = false
                script.Parent.Time.Value = 60
                wait(3)
                game.StarterGui.Notifications:Remove()
            else
                game.Workspace.Settings.Mines.Value = true
                game.Workspace.MinerGates.CanCollide = true
                script.Parent.Time.Value = 60
                script.Parent.Notifications.Frame.TextLabel.Text = "MINES ARE CLOSED"
                script.Parent.Notifications.Frame.TextLabel.TextColor3 = Color3.new(255, 0, 0)
                script.Parent.Notifications:Clone().Parent = game.Players.player.PlayerGui
                wait(3)
                game.StarterGui.Notifications:Remove()
            end
        end
    end
end
--255, 0, 0

while wait() do
    Countdown()
end

1 answer

Log in to vote
0
Answered by
Filipalla 504 Moderation Voter
6 years ago
Edited 6 years ago

game.Players.player.PlayerGui Need to be game.Players[player].PlayerGui Don't forget to accept the answer if it helped

Ad

Answer this question