"Workspace.SpawnEffects:25: attempt to call a Enum value"

I don’t know why this is happening, I would like some help.

I keep on getting “Workspace.SpawnEffects:25: attempt to call a Enum value”, No idea why.

Script:

game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
	local plr = p
	local char = c
	
	local col = BrickColor.new("Deep orange")
	local ct = 5
	
	local hea = char:WaitForChild("Head")
	local tor = char:WaitForChild("Torso")
	local ra = char:WaitForChild("Right Arm")
	local la = char:WaitForChild("Left Arm")
	local rl = char:WaitForChild("Right Leg")
	local ll = char:WaitForChild("Left Leg")
	
	local dcol1 = hea.BrickColor
	local dcol2 = tor.BrickColor
	local dcol3 = ra.BrickColor
	local dcol4 = la.BrickColor
	local dcol5 = rl.BrickColor
	local dcol6 = ll.BrickColor
	
	wait(0.05)
	
	hea.Material = Enum.Material("Force Field")
	tor.Material = Enum.Material("Force Field")
	ra.Material = Enum.Material("Force Field")
	la.Material = Enum.Material("Force Field")
	rl.Material = Enum.Material("Force Field")
	ll.Material = Enum.Material("Force Field")
	
	hea.BrickColor = col
	tor.BrickColor = col
	ra.BrickColor = col
	la.BrickColor = col
	rl.BrickColor = col
	ll.BrickColor = col
	
	wait(ct)
	
	hea.Material = Enum.Material("Smooth Plastic")
	tor.Material = Enum.Material("Smooth Plastic")
	ra.Material = Enum.Material("Smooth Plastic")
	la.Material = Enum.Material("Smooth Plastic")
	rl.Material = Enum.Material("Smooth Plastic")
	ll.Material = Enum.Material("Smooth Plastic")

	hea.BrickColor = dcol1
	tor.BrickColor = dcol2
	ra.BrickColor = dcol3
	la.BrickColor = dcol4
	rl.BrickColor = dcol5
	ll.BrickColor = dcol6
end)

end)

That is not how you reference an EnumItem, Enum.Material.ForceField and Enum.Material.SmoothPlastic is what you meant to use, please read documentation on the Material Enum next time

1 Like