I am trying to round values up in a function. However, before I even call that function, I get an error telling me that I am trying to perform an arithmetic on an Object. I believe the script thinks that the function's parameter is a 'userdata value'. Here is the code:
Server Script:
local movePartEvent = game.ReplicatedStorage.MovePartEvent local function round(X) return math.ceil(X + .50) end movePartEvent.OnServerEvent:Connect(function(...) local tuppleArgs = {...} local player = tuppleArgs[1] local value1 = tuppleArgs[2] local value2 = tuppleArgs[3] local value3 = tuppleArgs[4] game.Workspace.MovingPart.CFrame = CFrame.new(round(value1), 1, round(value3)) end)
Client Script:
local player = game:GetService("Players").LocalPlayer local mouse = player:GetMouse() script.Parent.MouseButton1Click:Connect(function() print("Clicked") while true do game.ReplicatedStorage.MovePartEvent:FireServer(player, (mouse.Hit.X), (mouse.Hit.Y), (mouse.Hit.Z)) wait(0.50) end end)
Thanks in advance!
Edit: I added the client script, although I don't think it has anything to do with my error. That is because I receive the error in my Server Script, on a function that I haven't even called yet.