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

Position is not a valid member of Vector3?

The error lies within Line 16 and Line 24

local event = script.Parent
local TweenService = game:GetService("TweenService")

event.OnServerEvent:Connect(function(Player, Ball, Hoop, Position, Release, ShotRating)
	print('received')
	local dir = {-1, 1}
	local force = Hoop.Position+Vector3.new((ShotRating/math.random(ShotRating,100))*dir[math.random(1,2)],20,(ShotRating/math.random(ShotRating,100))*dir[math.random(1,2)])


	--if Release == 'not scripted yet' then print'not ready' return end
	if Release == 'okay' then
		print'okay'
		--local RandomChance = math.random(1,3)
		--local POWER = Ball.Power.Value
		Ball.Parent = workspace
		Ball.Handle.Velocity = (Vector3.new(force.Position.X,Hoop.Position.Y,force.Position.X)-Ball.Handle.Position).unit*50
		--end
	else
		print'not scripted yet'
		--local RandomChance = math.random(1,3)
		--local POWER = Ball.Power.Value
		Ball.Parent = workspace
		wait()
		Ball.Handle.Velocity = (Vector3.new(force.Position.X + math.random(-2, 2),Hoop.Position.Y,force.Position.X)-Ball.Handle.Position).unit*50
		--end
	end
	wait()
	Player.PlayerGui.Meter.Enabled = false
end)

Been working on this script for hours, cant figure out what the issue is. The script is supposed to on a KeyDown fired event, this script basically makes a part transport to another brick from the Positions given. I'm assuming one of the Positions inside the Vector3 isn't really a ".Position" type

1 comment

0

I'll take a wild guess based my own experience and suggest that Ball.Handle.Position needs to be converted to a vector3. If you havent already tried it.

1 answer

Position is not a valid member of Vector3 means that your doing Vector3.Position. Position is not a property of Vector3, the Vector3 IS the position.

on line 24, you did Vector3.new(force.Position.X + math.random(-2, 2), force is a variable pointing to a vector3 so i think you mean to do Vector3.new(force.X + math.random(-2, 2)

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