Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I need to access the R15 parts of a character to adjust its properties how would I do this?

I'm trying to design a power that allows a player to become partially transparent, allowing them to sneak around easier, I have put down some basics of it, but I have absolutely no idea how accesses player models and adjust the transparency properties.

local bounkey1 = "f"

local usingPower = game.ServerStorage.powerValues.usingValues

local xp = game.ServerStorage.powerValues.XP

local Player = game.Players.LocalPlayer

local UIS = game:GetService("UserInputService")

	UIS.InputBegan:connect(function(InputObject,Processed)

  	  if not Processed and usingPower == false then

      	  if InputObject.KeyCode == Enum.KeyCode.boundkey1 then

          	  usingPower = true

				powerXP = XP - 40				

        end

    end

end)

1 answer

✓ Accepted answer

You use a for loop on your character and set what you want returned, which in this case is the BasePart.

local bounkey1 = "f"

local usingPower = game.ServerStorage.powerValues.usingValues

local xp = game.ServerStorage.powerValues.XP

local Player = game.Players.LocalPlayer

local UIS = game:GetService("UserInputService")

    UIS.InputBegan:connect(function(InputObject,Processed)

      if not Processed and usingPower == false then

          if InputObject.KeyCode == Enum.KeyCode.boundkey1 then

              usingPower = true

               powerXP = XP - 40      
				for _, v in pairs (Player.Character:GetChildren()) do
					if v:IsA("BasePart") then 
						v.Transparency = .5 -- Change here
					end
				end         

        end

    end

end)

3 comments

0

Then if you want the character to return after a certain amount of time, after line 22, you would add: wait(AMOUNTOFTIME) v.Transparency = 0

0

Thanks :)

0

Glad I could help

This discussion is preserved as it was. New answers, comments, and votes are closed.