pictureu
(pictureu)
July 28, 2023, 4:45pm
#1
hey there, so I’m trying to make a dialogue system which has been going well so far but an issue has occurred with my remote events, for some reason, anything I send after my 2nd variable goes arrives as nil on the other side, below are code examples, anyone ever have this happen to you?
Result:
the first two values, like when it says “words words words” and the 2 worked fine, bu the third one where I am begging it to work will always return nil no matter if its a string, number, color etc, I have never seen this happen.
thanks in advance.
2 Likes
taner60
(taner60)
July 28, 2023, 4:58pm
#2
don’t add the player variable to localscript.
(i triggered it 3 times)
get player with game.Players.LocalPlayer
in localscript
2 Likes
pictureu
(pictureu)
July 28, 2023, 5:26pm
#3
i havent used the player in the local script, its just the values
the image that I presented in my original post was of a server script
DevDAmaro
(DevDAmaro)
July 28, 2023, 5:31pm
#4
But you dont need to send the player
taner60
(taner60)
July 28, 2023, 5:32pm
#5
no, it must be in :FireClient()
, If you are using :FireAllClients()
player is not necessary.
pictureu
(pictureu)
July 28, 2023, 5:32pm
#6
how would i :fireClient then? it would not work without a player
DevDAmaro
(DevDAmaro)
July 28, 2023, 5:33pm
#7
Yeah mb I am on vacation and I dont use studio a long time ago
1 Like
DevDAmaro
(DevDAmaro)
July 28, 2023, 5:36pm
#8
And can you show the local script where it prints the values?
pictureu
(pictureu)
July 28, 2023, 5:43pm
#9
the entire thing? i sent a image of the part that matters in my last reply
Could you show how you connected to the RemoteEvent on the client? The server sided code seems fine.
pictureu
(pictureu)
July 28, 2023, 6:45pm
#11
i just did a
RemoteEvent:OnClientEvent:Connect(Talk)
you have to add Talk2, Talk3, etc. or just consider putting these words in a table.
example:
server script:
RemoteEventTalk:FireClient(plr,{"words words words",2,"please work i beg"})
local script:
RemoteEvent.OnClientEvent:Connect(Talk)
-- or
RemoteEvent.OnClientEvent:Connect(function(talktable)
print(talktable)
end)
pictureu
(pictureu)
July 28, 2023, 9:37pm
#13
i have already done that, the talk function has the word slots it needs, so it does have talk1 and talk 2