can someone explain why this isn’t working
local p = game.Players.LocalPlayer
local par = script.Parent
local rs = game:GetService("ReplicatedStorage")
if p.Backpack.Vessels.HasFrisk.Value == false then
script.Parent.ImageColor3 = Color3.fromRGB(50,50,50)
if p.Backpack.Vessels.HasFrisk.Value == true then
workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
CharacterAutoLoads = false
This is a local script
happens as soon as I start the game
Maybe the backpack isn’t loaded yet? Try to give some time to the player for loading.
right as the game starts btw
Try to put this after getting the player and then show what happens?
local char = p.Character or p.CharacterAdded:Wait()
or you can also do
local Backpack = game.Players.LocalPlayer:WaitForChild('Backpack')
Just for your info, if you get this kind of error for anything else, although the instance does exist, it’s best to use WaitForChild, as the script may have run before the instance has loaded. So next time, use WaitForChild if you get this kind of error again.
local backpack = game.Players.LocalPlayer.Backpack
local backpack = game.Players.LocalPlayer:WaitForChild("Backpack")