Need help with StarterCharacter script

Hi there everyone! So today I am trying to achieve a button gui where when clicked it enables a script inside startercharacterscripts. But for some reason when I try defining the script which is located in startcharacterscripts, nothing shows up. Keep in mind the script I am trying to activate is a local script.
(FYI I’m still learning to script).

Screenshot_294

You cannot access a player’s starter character scripts by using game.

Let’s say you have a script in a TextButton like this (called SCRIPT)

image

You need to do script.Parent.Parent.Parent.PlayerScripts.SCRIPT_TO_ACTIVATE.Disabled = false from a local script.

1 Like

I believe StarterCharacterScripts would only refer to the server’s standpoint, so you’d need to instead reference the Player’s Character Model that’s located inside the workspace if you want to enable your script properly:

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local FirstPersonScript = Character:WaitForChild("FirstPersonBodyParts")

script.Parent.MouseButton1Click:Connect(function()
    FirstPersonScript.Disabled = false
end)
2 Likes