I’m trying to call the LeftHand in the player’s character so I can turn the magazine model inside of it’s transparency to 0. I’m doing this because I dont know how to use animations or scripting to have visible magazines during reloading. The problem is that I don’t know how to call the player’s LeftHand from this script. Help?
What script?
Anyway - the left hand is a child of the character model. You can get the character model from the player too.
local player = ...
local character = player.Character or player.CharacterAdded:Wait()
local leftHand = characater:WaitForChild("LeftHand")
leftHand:WaitForChild("Magazine").Transparency = 0
can you elaborate what you mean by “calling the player’s LeftHand”? why would you need the left hand though if you’re just changing the transparency of the magazine, are you trying to weld the magazine to the left hand?
The magazine is welded to and inside the StarterCharacter’s LeftHand.
then just use what @Orbular3 recommended, then just grab the descendant of the LeftHand which is the magazine then just set the transparency of that, do checks to make sure it exists and such.
the script is a normal script, but for some reason, it has
local Player = game.Players.LocalPlayer
in it.
Then… change it? Don’t really know how to answer this
Well for it to call the character, it needs a player, but I don’t know how to call the player. The script is a normal one, and as far as I know local Player = game.Players.LocalPlayer
only works for localscripts
Just make the player whatever player you want the change to happen to, or, if it’s a pseudo animation, then you could handle it on the client instead.
i don’t think you should run your animation code on the server then if that’s the case. it just doesn’t seem ideal. you should be doing it on the client.
regardless, all tools when equipped get inserted into the character’s model, just tree up to the player’s character then reference LeftHand.
edit: reference the character onequip, then just set an already nil variable to that model.