I was creating a tool, and i wanted to select certain parts of a model to make that, when i unequip it will wield onto your waist. Problem is that it turns the transparency of **EVERY part, i only want 2 parts to be opaque (A Union and a part) And not to show the grip (Handle). Any help would be really greatful ! :)
PS : You don't have to worry about the other stuff, since it works just fine. This is a server script and is located in the ServerScriptService, ask me if you don't understand.
local radio = game.ServerStorage.Radio ---- Variables
local radio_c = radio:Clone()
local c_kids = radio_c:GetChildren
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local RightWaistAttachment = Instance.new("Attachment")
RightWaistAttachment.Name = "RightWaistAttachment"
RightWaistAttachment.Position = Vector3.new(0.8,-0.6,-0.5)
RightWaistAttachment.Parent = char.Torso
local M6D = Instance.new("Motor6D")
M6D.Name = "ToolGrip"
M6D.Parent = char.Torso
local Weld = Instance.new("Weld")
Weld.Name = "Radio_Wield"
Weld.Part0 = radio_c.PrimaryPart
Weld.Part1 = char.Torso
Weld.C0 = Weld.Part0.RightWaistAttachment.CFrame
Weld.C1 = Weld.Part1.RightWaistAttachment.CFrame
Weld.Parent = Weld.Part0
radio_c.Parent = workspace
for k,Part in pairs(c_kids) do
Part.Transparency = 1
end
end)
end)
game.ReplicatedStorage.ConnectM6D.OnServerEvent:Connect(function(plr, location)
local char = plr.Character
char.Torso.ToolGrip.Part0 = char.Torso
char.Torso.ToolGrip.Part1 = location
for k,Part in pairs(c_kids) do ---This
Part.Transparency = 1
end
end)
game.ReplicatedStorage.DisconnectM6D.OnServerEvent:Connect(function(plr)
plr.Character.Torso.ToolGrip.Part1 = nil
for k,Part in pairs(c_kids) do --- And this
Part.Transparency = 0
end
end)
