Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

PlayerScripts is not a valid member of Player?

Ok so heres my problem. I want to make basically a startup script that replaces the health, sound, animation, etc scripts. I also wanted to disable the scripts from PlayerScripts in game.Players.Player1 but when I try to disable it, it shows up as nil. Heres my script

--setup scrip v1.0

local Players = game:GetService("Players")
 
local function onCharacterAdded(character)
	print(character.Name .. " has joined the rumble")
	local playerc=game.Players:GetPlayerFromCharacter(character)
	
	character.Animate:remove()
	character.Sound:remove()
	character.Health:remove()
	
	playerc.PlayerScript.ControlScript.Disabled=true
	playerc.PlayerScript.CameraScript.Disabled=true
	--playerc.StarterPlayerScripts.ControlScript.Disabled=true
end
 
local function onCharacterRemoving(character)
	print(character.Name .. " has left the rumble")
end
 
local function onPlayerAdded(player)
	player.CharacterAdded:Connect(onCharacterAdded)
	--player.CharacterRemoving:Connect(onCharacterRemoving) --I'll reimplement this after main functions are done.
end
 
Players.PlayerAdded:Connect(onPlayerAdded)

playerc is the variable I'm having problems with. I even did a few different tests like waiting for 10-20 seconds(possibly a load error) but nothing. At some point I tried this

x=playerc:GetChildren()
for i=1, #x do
	print(x[i].Name)
end

And found that the only objects it registered were Backpack, PlayerGui, and StarterGear. If anyone can help me with found PlayerScripts that would be great.

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.