I get this error message: Workspace.Sounds.English.stayinthere.Script:3: attempt to index nil with 'PlayerGui'
My code:
local player = game:GetService("Players").LocalPlayer player.PlayerGui.DDIALOUGE.TextLabel.Text = "GUARD: Stay in there!" script.Parent.Playing = true wait(1.751) script.Parent.Parent.protip1.Script.Disabled = false script:Destroy()
The problem is that
local player = game:GetService("Players").LocalPlayer
returned nil.
This is only the case if your script is ran from the server. Which doesnt have .LocalPlayer
Try to use cross-server communication to retrieve the player, or other methods such as getting their player through
game:GetService("Players"):GetPlayerFromCharacter() --works on the server
hope this helped.