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 7 years ago
01local door = script.Parent
02 
03--//Main Event
04door.ClickDetector.mouseClick:connect(function()
05for i,v in pairs(game:GetPlayers()) do
06        v.PlayerGui.Objectives.LockedText.Visible = true
07        wait(5)
08        v.PlayerGui.Objectives.LockedText.Visible = false
09    end
10end)

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 7 years ago
01local door = script.Parent
02 
03--//Main Event
04door.ClickDetector.mouseClick:connect(function()
05for i,v in pairs(game.Players:GetChildren()) do
06        v.PlayerGui.Objectives.LockedText.Visible = true
07        wait(5)
08        v.PlayerGui.Objectives.LockedText.Visible = false
09    end
10end)

Try this

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

Answer this question