PlayerScripts is not a valid member of Player?
Asked by
6 years ago Edited 6 years ago
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
03 | local Players = game:GetService( "Players" ) |
05 | local function onCharacterAdded(character) |
06 | print (character.Name .. " has joined the rumble" ) |
07 | local playerc = game.Players:GetPlayerFromCharacter(character) |
09 | character.Animate:remove() |
10 | character.Sound:remove() |
11 | character.Health:remove() |
13 | playerc.PlayerScript.ControlScript.Disabled = true |
14 | playerc.PlayerScript.CameraScript.Disabled = true |
18 | local function onCharacterRemoving(character) |
19 | print (character.Name .. " has left the rumble" ) |
22 | local function onPlayerAdded(player) |
23 | player.CharacterAdded:Connect(onCharacterAdded) |
27 | 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
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.