✓ Accepted answer
Several mistakes here, but it's nothing too difficult to fix.
First of all, when you use player_arm on lines 7 and 10, the script ignores your variable and tries to look for a part named "player_arm". This is the first error. To fix this, use brackets or the FindFirstChild function.
while true do
wait(1)
player[player_arm].Transparent=.5
end
if player:FindFirstChild(player_arm).Transparent==.5 then
print('Working!!!')
end
Second, LocalPlayer redirects to the Player itself (the one that contains PlayerGui, Backpack, etc.), not the model that contains parts. To fix this, redirect to the player's model by using .Character.
while true do
wait(1)
player.Character[player_arm].Transparent=.5
end
Third, the property you're thinking of is called "Transparency", not "Transparent".
while true do
wait(1)
player.Character[player_arm].Transparency=.5
end
Your completed script should now look like this:
player = game.Players.LocalPlayer
local player_arm = "Left Arm"
while true do
wait(1)
player.Character[player_arm].Transparency=.5
end
if player.Character[player_arm].Transparency==.5 then
print('Working!!!')
end
I hope this helps! If you found my answer helpful you can upvote and accept it. If you have any questions, just ask.
4 comments
I got ninja'd again
Very well explained(: +1
Thank you!
Thanks, it is very well explained too. and thanks for your effort