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

(Solved) Could someone figure out why the PlayerScripts do not want to remove? [closed]

Asked by
Myaxp 3
8 years ago

I am build a Menu for a HOLO. I have the cameras working and so is the GUI(But the button is not working because of the PlayerScripts)

My attempt was to remove the PlayerScripts(CameraScript and ControlScript) then when I press the button, the PlayerScript that I have a copy of will be ":clone()" into the Player's PlayerScript folder.

The problem it is wont delete nor add the script because of the following: "attempt to index global 'p' (a nil value)" on any line that uses... "p".


--//Myaxp game.Players.ChildAdded:connect(function(p) -- Another script loads the PlayerScripts into the player through a button. --a = game:GetService("Players").LocalPlayer wait(1) --a = game:GetService("Players") p.LocalPlayer.PlayerScript.CameraScript:Destroy() p.LocalPlayer.PlayerScript.ControlScript:Destroy() end) --//End

BTW, "Line 4" had PlayerAdded but seemed to have no effect, neither does ChildAdded. So I don't know what I did wrong.

Can someone figure out the problem?

--//Myaxp

0
Is it local script? Mokiros 135 — 8y
0
It was... But it had no effect. It is also why I had Child Added! Myaxp 3 — 8y
0
p is a Player, not "Players" service. LocalPlayer is useless. And it must be PlayerScripts, not PlayerScript Mokiros 135 — 8y
0
... Oh. Did not noticed for the 20 minutes I stared at the code... I will try it. Myaxp 3 — 8y
View all comments (2 more)
0
However loading up the explorer in "test" mode, There is no StarterScripts... Is this normal?????? Myaxp 3 — 8y
0
Nvm I sorted it. Myaxp 3 — 8y

Locked by HungryJaffer and Redbullusa

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?