Cancollide issue

there’s this issue whenever i tried to trigger the event. this script works very well before but after i stop scripting for a while, this script suddenly doesn’t works

spawn(function()
		local Arm
		local p1
		local LeftOrRight = math.random(1,2)
		local p0 = stand.HumanoidRootPart.Position
		local sv = p.StandValue
		if sv.Value == "SP" then
			if LeftOrRight == 1 then
				-- left arm--
				Arm = game.ServerStorage.StandModel.StarPlanet_Handclone["Left Arm"]:Clone()
				Arm.Orientation = Arm.Orientation + Vector3.new(0,math.random(90),0)
				Arm.Position = stand.LeftLowerArm.Position
				Arm.Parent = game.Workspace
				p1 = Character.HumanoidRootPart.Left.WorldPosition + Vector3.new(0,math.random(-7.5,7.5),0)
			else
				Arm = game.ServerStorage.StandModel.StarPlanet_Handclone["Right Arm"]:Clone()
				Arm.Position = stand.RightLowerArm.Position
				Arm.Orientation = Arm.Orientation + Vector3.new(0,math.random(90),0)
				Arm.Parent = game.Workspace
				p1 = Character.HumanoidRootPart.Right.WorldPosition + Vector3.new(0,math.random(-7.5,7.5),0)
			end
			for i,v in pairs(Arm:GetDescendants()) do
				if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") then
					v.Transparency = .2
					game.TweenService:Create(v,TweenInfo.new(.3),{Transparency = .75 }):Play()
				end
			end	
		end
		
		Arm.CanCollide = false
		Arm.Anchored = true

here’s the output

1 Like

If this condition isn’t true, then Arm would be nil, and cause that error. Try using something like:

if Arm then
	Arm.CanCollide = false
	Arm.Anchored = true
end

to make sure Arm isn’t nil.

1 Like

the sv thing is actually for the system to determine which part to clone so i don’t think its related to it

1 Like

and also i tried it


it becomes

1 Like

nvm my fault its supposed to be full form instead of short form

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.