I want to achieve a player stepping on a button which calls a remote event. The remote event then calls a ModuleScript which will clone a house model from ReplicatedStorage and place it into a folder in the workspace.
For a while, everything was working fine, but I then added another parameter to the function in the ModuleScript which was a Vector3 value. This parameter is used to change the model’s position alongside GetPivot depending on the button that is touched.
Here is the error I continuously get: “Name is not a valid member of Vector3”
Here is my code for both the Server and ModuleScript.
Server:
RemoteEvent1.OnServerEvent:Connect(function(player)
if game:GetService("Players"):FindFirstChild(player.Name).Data1.homeOwned.Value == false then
modulescript.spawnBaseHome(player, Vector3.new(0, 0, 0))
end
end)
Here is the required ModuleScript:
function home1:spawnBaseHome(player, position)
local house = baseHome:Clone()
house.BillboardGui.TextLabel.Text = player.Name.."'s house"
house.Parent = workspace
button1.Parent = ReplicatedStorage
sign1.Text = "Sold to ".. player.Name
house:PivotTo(house:GetPivot() + position)
end
house is the model I am cloning, sign1 is a sign outside of the model which changes text. and button1 is what gets touched to trigger the event, which then moves to ReplicatedStorage with this function.
The error specifically comes from the below line in the ModuleScript:
house.BillboardGui.TextLabel.Text = player.Name.." 's house"
I have tried to many variations on the formatting and syntax and have yet to find a solution. Any help is greatly appreciated, thanks in advance.