Hello, everyone! My name is Oliver and I’m currently having trouble with a script that I was given by a developer of mine. I was attempting to put it into a GUI for our law enforcement officers, but I was having trouble. I will now explain what I’m attempting to do. I’m attempting to make it so when one of our officers clicks the gui it will give them latex gloves, but I was having trouble with the script. There is one error in output and it says “Error, RightArm is not a valid member of 36bandzz.” Tell me if you can help, I’ll leave the script below
Server Sided Script
local GetGlove = game:GetService("ReplicatedStorage").GetGloves
GetGlove.OnServerEvent:Connect(function(Player, Needed)
if Player.Character:FindFirstChild("LeftArm") then
Player.Character.LeftArm:Destroy()
Player.Character.RightArm:Destroy()
else
local hit = Player.Character.Torso
if hit.Parent:findFirstChild("Humanoid") ~= nil and hit.Parent:findFirstChild("RightArm") == nil then
local g = script.RightArm:clone()
g.Parent = hit.Parent
local C = g:GetChildren()
for i=1, #C do
if C[i].className == "Part" or "Union" then
local W = Instance.new("Weld")
W.Part0 = g.Middle
W.Part1 = C[i]
local CJ = CFrame.new(g.Middle.Position)
local C0 = g.Middle.CFrame:inverse()*CJ
local C1 = C[i].CFrame:inverse()*CJ
W.C0 = C0
W.C1 = C1
W.Parent = g.Middle
g.Middle.Transparency = 1
end
local Y = Instance.new("Weld")
Y.Part0 = hit.Parent["Right Arm"]
Y.Part1 = g.Middle
Y.C0 = CFrame.new(0, 0, 0)
Y.Parent = Y.Part0
end
local h = g:GetChildren()
for i = 1, # h do
h[i].Anchored = false
h[i].CanCollide = false
end
end
end
end)
GetGlove.OnServerEvent:Connect(function(Player, Needed)
if Player.Character:FindFirstChild("LeftArm") then
Player.Character.LeftArm:Destroy()
Player.Character.RightArm:Destroy()
else
local hit = Player.Character.Torso
if hit.Parent:findFirstChild("Humanoid") ~= nil and hit.Parent:findFirstChild("LeftArm") == nil then
local g = script.LeftArm:clone()
g.Parent = hit.Parent
local C = g:GetChildren()
for i=1, #C do
if C[i].className == "Part" or "Union" then
local W = Instance.new("Weld")
W.Part0 = g.Middle
W.Part1 = C[i]
local CJ = CFrame.new(g.Middle.Position)
local C0 = g.Middle.CFrame:inverse()*CJ
local C1 = C[i].CFrame:inverse()*CJ
W.C0 = C0
W.C1 = C1
W.Parent = g.Middle
g.Middle.Transparency = 1
end
local Y = Instance.new("Weld")
Y.Part0 = hit.Parent["Left Arm"]
Y.Part1 = g.Middle
Y.C0 = CFrame.new(0, 0, 0)
Y.Parent = Y.Part0
end
local h = g:GetChildren()
for i = 1, # h do
h[i].Anchored = false
h[i].CanCollide = false
end
end
end
end)
Client Sided Script
local LatexButton = script.Parent.LatexButton
local Player = game.Players.LocalPlayer
local LatexFire = game:GetService("ReplicatedStorage").GetGloves
LatexButton.MouseButton1Click:Connect(function()
if Player:IsInGroup(9499290) or Player:IsInGroup(9505797) then
print("Group Valid")
LatexFire:FireServer("Accepted")
else
LatexFire:FireServer("Denied")
end
end)
Thanks if you can help, sorry for wasting your time if you can’t.