I have no idea why the positioning is not working here, can anyone help me out? Everything works minus the position of the new part which can be found on line 5 of the server code.
Are you getting any errors in the output?
No, I also tried to print the value of the remote event and got nothing from it
Text values are strings. You need to convert these values into numbers by using tonumber()
new.Positon = Vector3.new(tonumber(x), 0, tonumber(z))
x, y
are strings
, you must tonumber
and then apply them to the Vector3
(and also make sure they are numbers in the first place):
local event = game.ReplicatedStorage.BFEvents.FriendlyHQ
--store the reference to the objects not the .Text property!(assuming x, y aren't constants)
local XInput = script.Parent.Parent.X
local ZInput = script.Parent.Parent.Z
script.Parent.MouseButton1Click:Connect(function()
--you where also not updating the text
x, z = tonumber(XInput.Text), tonumber(ZInput.Text)
if x and y then --if both values are numbers
event:FireServer(x,z)
end
end)
1 Like
Disregard the last post, fixed. Thanks for all your help everyone!
1 Like