#It says that the parameter is nil even though it exists on both the client and server
279 messages · Page 1 of 1 (latest)
I mean fully viewing it
which parameter
ok
The part that I make on the server doesn't replicate in the time it takes for RemoteEvent on the client to receive :OnClientEvent
ðŸ˜
oh
I might ask a question later
okay
gotta go get mickey d's
anyways how would I make sure that part exists on the client after the clients receives the remote?
Pass the instance in the event and check if workspace.part == passedPart
Or if passed part then...
it's not really like only one of the part that exists will be named part
or "Handle" as I named it
sorry for not responding 💀
well I mean it doesn't exist at the time of running it
so I gotta make sure it exists first or else nothing really happens
anyways if I were to do if workspace.part == passedPart nothing would happen because passedPart doesn't exist for the client yet
and this would happen for every new part I would have to make
No I corrected that
really?
Use if workspace:FFC(passedpart) instead
O yeah
yeah it says missing argument
doesn't that also use a string?
Yeah
I'll try it
But you could pass the name of the part
I have an idea
yeah?
local try
repeat
try = workspace:WaitForChild(passedName)
task.wait()
until try == passedPart
how do I turn on no check for a script?
What
O
I asked about nocheck since it turns off type-checking ðŸ˜
What error
attempted to index nil with name ðŸ˜
well uhh I forgot to add a wait
ðŸ˜
well I can't get the part itself so all I have is the name ðŸ˜
Yeah
So pass the name
And instead of passedPart.Name do passedPart
Or I guess you should change it to passedName
nah I'll just pass both the name and the instance
Updated this
Okay but passing the instance raised an error last time
yeah I passed the instances name instead of doing instance.Name
yeah but I hope that after the instance's name is checked by the until loop
that the instance actually exists
wait
O yea
But
That would also raise an error
😠forgot
Wait it wouldn't
🥴
I fixed it 💀
I think I broke my code ðŸ˜
uh oh
No
try checks the instance of the part
but try is defined as wait for child
With the name
This
how could it ever equal an instance if it's trying to set try as a string?
It's not
really?
Probably bc there's multiple
** You are now Level 20! **
nah there's only one part named Handle
And nil?
Oh
It's cuz it's being fired before the instance is created
Wait
Nevermind I just realized 💀
I don't think local functions run until they're called though ðŸ˜
** You are now Level 10! **
thanks mee6
Can I see the reciveing script
alr
there is some stuff I don't think really matters in the script but here you go
the main problem in the repeat loop
where it'll never meet the conditions so the rest of the script never runs
ðŸ˜
because if I put a print(instance) in the serverscript
it prints
completely fine
but when I fire it through the remote event
it's nil because the part hasn't replicated it yet
Idk if that's the problem
Try calling the fire function without task.delay
And on server event, add a task.wait(5) or something
Just to see if it ever gets replicated
Or if something else is causing this
at this point u just gotta try everything ¯_(ツ)_/¯
No I meant
this replication problem is beating my ass man
Call it normally but add a wait in the recieving function
Then instead of referencing the handle from the arguments, do print(workspace.Handle)
Yep
Wdym
Comment out the repeat
I just wanna know if the handle ever gets replicated or if it's another issue
yeah I know
Now try the same thing but only change the reference
Instead of workspace.Handle use the passed Handle
With the wait 5?
and see what happens
o
Is there a reason you use delay
Instead of calling normally
Try using spawn(function, false)
I don't remember if the second param is a number or bool
But 0 or false
I was tryna see if it was firing the remote before handle existed
Was it?
Oh
it was ENTIRELY a replication problem
because when the client receives the remote Handle doesn't exist yet so it errors and ruins my day
Wait so then what was the real problem
💀
there's delay when the server replicates the existence of a part
Well anyway glad it's fixed
Yeah but I didn't think it would be that large
Np
Happens all the time lol
it doesn't even have to be large it just has to be the slightest bit slower than the remote ðŸ˜
it was beating the shit out of me though
That's not what I meant
Imma try to finish up this script and see if there's any more errors
But wtvr have fun 🥲
yay
man I give up
I just put task.delay for 0.05
and it works
I can't be totally accurate and proud of it anymore ðŸ˜
but
it works
Lol
it's kinda slapped together but it works
Does calling it normally not work?
I would have to add a task.wait for an appropriate amount of time
I don't even know what to do
since server to client replication is based on the client's internet
so someone who is incredibly laggy might not get the replication in 0.05 seconds
ðŸ˜
Yeah that's when you probably have to use something to wait for it
I can't think of something off the top of my head
also I the repeat loop would not work
I can try when I get home but I'm not at my PC rn
ok
the repeat loop would not work because the Handle parameter is nil when it is received, so all I'm doing is setting try == nil ðŸ˜
what's serializing?
Idk it sounds cool
From what I know, it's making data into a Jason
Json
But idk how to
Let's ask the Roblox ai
