game.Players.Player.PlayerScript:Destroy()
Put it in a local script in the player, I don't know if you want only delete playerScript or all of the scripts
If you only want to destroy the camerascript
local player = game.Players.LocalPlayer local playerScripts = player:WaitForChild("PlayerScripts") local cameraScript = playerScripts:WaitForChild("CameraScripts") cameraScript:Destroy()
if you want to destroy all scripts in PlayerScript, you need to get all children from the playerScript like this
local player = game.Players.LocalPlayer local playerScripts = player:WaitForChild("PlayerScripts") for _, script in next, playerScripts:GetChildren() do script:Destroy() end cameraScript:Destroy()
If you want to destroy the camera script in the player, then you should use WaitForChild
on the playerscripts object and then use it again for the camerascript in case those objects haven't been created within the player yet.
local players = game:GetService'Players' local playerscripts = players["playername"]:WaitForChild'PlayerScripts' -- Put the player's name where playername is local camerascript = playerscripts:WaitForChild'CameraScript' -- Wait for the camerascript camerascript:Destroy() -- Destroy it
make sure the script is a LocalScript and place it in StarterGui or StarterPack
game.Players.LocalPlayer.PlayerScript:remove()