Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does this print "true" when it should print a vector3?

Asked by
OBenjOne 190
5 years ago
Edited 5 years ago

I wanted to put: Why does this print "true" when it should print (0,0,-5)? As my question but it didn't let me. I know CFrame isn't a regular vector3 (not that CFrames are abnormal or anything)

My local script (copied from the wiki but with some changes)

 local ReplicatedStorage = game:GetService("ReplicatedStorage")
 local createPartEvent = ReplicatedStorage:WaitForChild("CreatePartEvent")

createPartEvent:FireServer(0,true,true, CFrame.new(0, 0, -5),1.25)

My server script (also copied from the wiki with some modifications)

-- Script

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local createPartEvent = Instance.new("RemoteEvent", ReplicatedStorage)
createPartEvent.Name = "CreatePartEvent"

local function onCreatePartFired(number1,bool1,bool2,CFrame1,number2)
print (CFrame1)
end

createPartEvent.OnServerEvent:Connect(onCreatePartFired)

For some reason this prints "true"

NOTE: this was written on an iPhone so there may be something wrong with it.

0
The first parameter to OnServerEvent is always the player that fired the remote. So on the function onCreatePartFired, before number1, add a player parameter. Do not include it in FireServer User#19524 175 — 5y
0
I will try that, thanks! OBenjOne 190 — 5y

Answer this question