game.ReplicatedStorage.Wormhole.OnServerEvent:Connect(function(player,to:Vector3,from:Vector3,duration:number)
local worm = CreateWarp(to,from,duration)
worm = workspace:WaitForChild(worm.Name)
game.ReplicatedStorage.Wormhole:FireClient(player,worm)
end)
So this code does stuff to make a union serversided (I have to make unions in a server script idk why)
The worm = workspace:WaitForChild(worm.Name)
is to try to make it not return nil.
Funny thing is, if I print the union, or the unions parent in the server script, everything prints fine.
It exists.
But if I print it in the local script, -
game.ReplicatedStorage.Wormhole.OnClientEvent:Once(function(wormhole)
print(wormhole)
end)
-then it prints nil.
UNLESS I ADD A TASK.WAIT, Bruuuh.
I don’t know why the local script keeps complaining that the union doesn’t exist, when I CAN LITERALLY SEE IT IN FRONT OF MY EYES, and the server script says that it exists, because it does.