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

This script for my Locked Door doesn't seem to work?

Asked by 6 years ago
local door = script.Parent

--//Main Event
door.ClickDetector.mouseClick:connect(function()
for i,v in pairs(game:GetPlayers()) do
        v.PlayerGui.Objectives.LockedText.Visible = true
        wait(5)
        v.PlayerGui.Objectives.LockedText.Visible = false
    end
end)

For some reason this script doesn't work? I always get this error that says, 'GetPlayers is not a valid member of DataModel'. Can somebody please help me?

1 answer

Log in to vote
0
Answered by 6 years ago
local door = script.Parent

--//Main Event
door.ClickDetector.mouseClick:connect(function()
for i,v in pairs(game.Players:GetChildren()) do
        v.PlayerGui.Objectives.LockedText.Visible = true
        wait(5)
        v.PlayerGui.Objectives.LockedText.Visible = false
    end
end)

Try this

0
instead of get children do get players ^ Earthkingiv 51 — 6y
0
Thank you so much! CrimsonFlux 6 — 6y
Ad

Answer this question