Scripting Helpers is winding down operations and is now read-only. More info→
Log in to vote

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

Asked by 1 year ago

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 +,1,0)
        blur.Size = 54

        char.JumpPower = 50
        char.WalkSpeed = 16
        blur.Size = 0


1 answer

Log in to vote
Answered by 1 year ago
Edited 1 year ago

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 +,1,0)

Answer this question