I have a handle, inside a tool, and once the tool equips, the mesh inside the tool will change it's texture. However, only the client can see the mesh's texture change, not the rest of the server. I therefore created a remote event which contacts the server, and the server would then change the texture of the mesh, so that all clients can see the texture change. I have set up a server script to do this task when it recieves the RemoteEvent, containing the player's name, from the client, but whenever I run the script I get the following error on line 2: 'Attempt to index a nil value.' The tool is called 'Excel Energy', and the RemoteEvent is called 'ExcelEnergyOpenCan'.
local function eventFired(player)
player.Backpack:FindFirstChild("Excel Energy").Handle.Mesh.TextureId = "rbxassetid://2175878581"
end
game:GetService("ReplicatedStorage").Events.ExcelEnergyOpenCan.OnServerEvent:Connect(eventFired)

5 comments
there might be no "Backpack" inside the player, no "Excel Energy" inside the Backpack or no handle or mesh inside excel energy.
Is there a way to check if each individual object exists? To find out which one is nil? You could try something like this: local function eventfFired(player) player:FindFirstChild("backpack") print ("Backpack exists") player.backpack:FindFirstChild.... ect
Do :WaitForChild()
no
@radusavin366 What do you mean no Backpack inside the player? Every player spawns with a backpack..