Why doesn't this work?

I’ve got this script that changes the transparency of the shotgun shell model inside the player’s LeftHand to 0, then back again after the animation has played, and the shell has been “inserted”. I don’t get any errors, but for some reason it doesn’t work. Help? This is inside of a normal script btw.

local Tool = script.Parent

local Character = Tool.Parent

local debounce = false


		
Reload.OnServerEvent:connect(function(Player, bulletPos) ---reload line
	if not debounce then
		
		debounce = true  -- do not delete these two
		debounce = false
		
		
		wait(1)
		
		
	script.Parent.Handle.InsertShell:Play()
		
	Character.LeftHand.ShotgunShell.Transparency = 0
	
	end
end)
1 Like

is shotgunshell a model, or a part?

Use breaking points or print to find out where it doesn’t work. Then tell me where the code stops.

it’s a union inside of the LeftHand

local debounce = false
		
Reload.OnServerEvent:connect(function(Player, bulletPos)
if not debounce then		
script.Parent.Handle.InsertShell:Play()	
Player.Character.LeftHand.ShotgunShell.Transparency = 0
debounce = true
wait(1)
debounce = false
end
end)
1 Like