Unable to assign property Position. Vector3 expected, got nil

Hey, im currently making a roblox booth system which people can change their booths by pressing on a button, everything seems to be working properly except for getting the booth’s position from a script to another. when i try to, im getting this error:
image

these are my scripts:
server script which is located in all of the booths:

script.Parent.ProximityPrompt.Triggered:Connect(function(player)
	local boothOwner = script.Parent.Parent.Owner
	if boothOwner.Value == "Noone" or boothOwner.Value == player.Name then
		if not player:FindFirstChild("OwnsBooth") then
			script.Parent.Parent.Owner.Value = player.Name
			script.Parent.Parent.Base.SurfaceGui.TextLabel.Text = "Owned By: " .. player.Name
			script.Parent.ProximityPrompt.ActionText = "Edit Booth"

			local tag = Instance.new("BoolValue")
			tag.Name = "OwnsBooth"
			tag.Parent = player

			if boothOwner.Value == player.Name then
				local boothName = "Booth1"  -- Replace "Booth1" with the appropriate booth name
				local boothPosition = script.Parent.Parent.Select.Position
				print("Booth position:", boothPosition)
				print("Select object:", script.Parent.Parent.Select)
				game.ReplicatedStorage.ChangeBooth:FireClient(player, boothName, boothPosition)
			end
		end

		game.ReplicatedStorage.BoothTextGui:FireClient(player)
	else
		warn("You do not own this booth.")
	end
end)

server script in serverscriptservice:

game.ReplicatedStorage.ChangeBooth.OnServerEvent:Connect(function(player, boothName, boothPosition)
	print("Received change booth request from:", player.Name)
	print("Booth name:", boothName)
	print("Booth position:", boothPosition)

	local boothTemplate = game.ReplicatedStorage.Booths:FindFirstChild(boothName)
	if boothTemplate then
		print("Booth template found:", boothName)
		local newBooth = boothTemplate:Clone()
		newBooth.Parent = game.Workspace.Booths
		newBooth.Owner.Value = player.Name
		newBooth.Position = boothPosition  -- Set the position of the new booth
	else
		warn("Booth template not found in the ReplicatedStorage.")
	end
end)

its getting the actual position properly aswell, i can confirm that from the prints

1 Like

Is the booth a model? Or is it just a standard part

If they are both server scripts, why is the top one firing to the client? Wouldn’t the second one not receive the event?

What exactly is the booth? Is it a model?

2 Likes

it used to be, i just realised how that couldnt work since the booth in the replicatedstorage was a simple part for testing purposes so i changed it back to a model, but now i’m wondering how i can get the model’s position, any ideas? I tried making it by getting the position directly, but im getting this error:
image

this is my scripts:
script in every booths:

script.Parent.ProximityPrompt.Triggered:Connect(function(player)
	local boothOwner = script.Parent.Parent.Owner
	if boothOwner.Value == "Noone" or boothOwner.Value == player.Name then
		if not player:FindFirstChild("OwnsBooth") then
			script.Parent.Parent.Owner.Value = player.Name
			script.Parent.Parent.Base.SurfaceGui.TextLabel.Text = "Owned By: " .. player.Name
			script.Parent.ProximityPrompt.ActionText = "Edit Booth"

			local tag = Instance.new("BoolValue")
			tag.Name = "OwnsBooth"
			tag.Parent = player

			if boothOwner.Value == player.Name then
				local boothName = "Booth1"  -- Replace "Booth1" with the appropriate booth name
				local boothPosition = script.Parent.Parent.Parent.Booth1.Position
				print("Booth position:", boothPosition)
				print("Select object:", script.Parent.Parent.Parent.Booth1)
				game.ReplicatedStorage.ChangeBooth:FireClient(player, boothName, boothPosition)
			end
		end

		game.ReplicatedStorage.BoothTextGui:FireClient(player)
	else
		warn("You do not own this booth.")
	end
end)

script in serverscriptservice:

game.ReplicatedStorage.ChangeBooth.OnServerEvent:Connect(function(player, boothName, boothPosition)
	print("Received change booth request from:", player.Name)
	print("Booth name:", boothName)
	print("Booth position:", boothPosition)

	local boothTemplate = game.ReplicatedStorage.Booths:FindFirstChild(boothName)
	if boothTemplate then
		print("Booth template found:", boothName)
		local newBooth = boothTemplate:Clone()
		newBooth.Parent = game.Workspace.Booths
		newBooth.Owner.Value = player.Name
		newBooth.Position = boothPosition  -- Set the position of the new booth
	else
		warn("Booth template not found in the ReplicatedStorage.")
	end
end)

can u check my reply with @Doomcolp3?

You should make one of the parts, preferably the part that displays stand info the PrimaryPart of the model. Then instead of setting the position, you should set the PrimaryPart’s CFrame so it moves the whole model.

You could also use PivotTo and not have to do the stuff above but it’s your choice

Use Model:PivotTo(CFrame) instead of position.

i’m quite unsure how to really use PivotTo in my case, can you help out? I tried making it by myself, but ended up looking quite ugly

:PivotTo(CFrame.new(boothPosition)

Might work