Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

attempt to perform arithmetic (add) on Instance and Vector3?

I have this script in a part and whenever you touch it you're supposed to have a blurry vision and some spinning ducks spawn on your head like in cartoons when they're dizzy. Now that I've cloned it I change it's parent to the hit.Parent.head which is the player's head and I wanted to make it higher but this error pops up. Can anyone help? Here is the script

local boulder = script.Parent

function onTouch(hit)
	local char = hit.Parent:FindFirstChild("Humanoid")
	if char then
		local vfx = game.ReplicatedStorage:WaitForChild("VFX")
		local dizzyDucks = vfx.Dizzy:Clone()
		local blur = game.Lighting.Blur
		char.JumpPower = 0
		char.WalkSpeed = 0
		dizzyDucks.Parent = hit.Parent.Head + Vector3.new(0,1,0)
		blur.Size = 54
		
		wait(3)
		char.JumpPower = 50
		char.WalkSpeed = 16
		dizzyDucks:Destroy()
		blur.Size = 0
	end
end

boulder.Touched:Connect(onTouch)

1 answer

✓ Accepted answer

hit.Parent.Head is a Instance, and you want to add it with Vector3.

I think you meant:

dizzyDucks.Parent = hit.Parent.Head
-- or
dizzyDucks.Parent = hit.Parent.Head
dizzyDucks.Position = dizzyDucks.Position + Vector3.new(0,1,0)

This discussion is preserved as it was. New answers, comments, and votes are closed.