Why is my script no works

hello robloxians,
so i just try to make a bubble/ball like inside bubble gum simulator.
and there is a UserData error sombody know why?
here is the script:

game.Players.PlayerAdded:Connect(function()
	script.Parent.Size = Vector3.new(0.05,0.05,0.05)
end)

game.Workspace.Events.BlowingBallon.OnServerEvent:Connect(function(plr)
	while wait(0.01) do
		script.Parent.Parent.Parent.Humanoid.JumpPower = plr.Hidden.Ballons.Value
		script.Parent.Size = Vector3.new(plr.Hidden.Ballons.Value / 5,plr.Hidden.Ballons.Value / 5,plr.Hidden.Ballons.Value / 5)
		script.Parent.SurfaceGui.TextLabel.Text = plr.Hidden.Ballons.Value
		script.Parent.Parent.AttachmentUp = Vector3.new(0,1,0)
		script.Parent.Parent.AttachmentRight = Vector3.new(1,0,0)
		script.Parent.Parent.AttachmentPos = Vector3.new(0,0,0)
		script.Parent.Parent.AttachmentForward = Vector3.new(0,0,-1)
		if script.Parent.Parent.Parent.Humanoid.JumpPower >= 350 then
			script.Parent.Parent.Parent.Humanoid.JumpPower = 350
		end
		
		if script.Parent.Size >= script.Parent.MaxSizeValueBall.Value then
			script.Parent.Size = script.Parent.MaxSizeValueBall.Value
		end
		
	end
end)

and the error is in line 18 of this script.
thanks for help,
REALINONOOBYT.

1 Like

You are trying to compare vectors, which makes no sense. You should compare either their module (a) or each one of their compounds (b):

a)

if script.Parent.Size.Magnitude >= script.Parent.MaxSizeValueBall.Value.Magnitude then

b)

if script.Parent.Size.X >= script.Parent.MaxSizeValueBall.Value.X and script.Parent.Size.Y >= script.Parent.MaxSizeValueBall.Value.Y and script.Parent.Size.Z >= script.Parent.MaxSizeValueBall.Value.Z then

In this case, consider changing and operator with or depending on your needs.

now is no show error but is no max the ball size to 40,40,40 which is the Vector3 Value that i am use. nevermind i change a little bit the script and is works now. thank you <3

1 Like