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

Local Player is nil.. Help? [SOLVED]

Asked by 6 years ago
Edited 6 years ago

Guys I need help with this error that has been messing me up since I got it for the first time. Basicly the script works in studio perfectly. But, in game when I click the "Part" it says that "LocalPlayer" is a nil value..

Here's the script:

script.Parent.ClickDetector.MouseClick:connect(function()
    script.Disabled = true
    local backup= game.Players.LocalPlayer.PlayerGui.CatchStuffMinigame:Clone()
game.Players.LocalPlayer.PlayerGui.CatchStuffMinigame.Background:TweenPosition(UDim2.new(0,600,0,100),"In","Linear",2)
wait(10)
game.Players.LocalPlayer.PlayerGui.CatchStuffMinigame.Background:TweenPosition(UDim2.new(0,-400,0,100),"Out","Linear",2)
wait(2)
game.Players.LocalPlayer.PlayerGui.CatchStuffMinigame:Remove()
backup.Parent = game.Players.LocalPlayer.PlayerGui
wait(20)
script.Disabled = false
end)

If anyone could help me it would be GREAT!

0
Youre gonna need to use a remote function or remote event. There complex but they help a lot. GottaHaveAFunTime 218 — 6y

1 answer

Log in to vote
0
Answered by
Prestory 1395 Moderation Voter
6 years ago

Its probably because your using a script use a local script

0
Neh last time i copied the whole script and paste it and testing local script and script it one by one all i saw is this Sleepingthebloop 0 — 6y
0
00:08:10.335 - CatchStuffMinigame is not a valid member of PlayerGui Sleepingthebloop 0 — 6y
0
I'll try the so local script.. I don't think it's gonna do much to be honest. wilsonsilva007 373 — 6y
0
As I expected. It didn't work wilsonsilva007 373 — 6y
Ad

Answer this question