Remote event parameter coming up as nil for some reason

I have a remote event script, OnClientEvent to be specific

when i fire the event, i have the following parameters

--The server firing the event
game.ReplicatedStorage.talkBegin:FireClient(plr, script.Parent.Parent.noteInfo.Criminal.Value,script.Parent.Parent.noteInfo.deathMethod.Value, script.Parent.Parent.Name)

--The client activating it
game.ReplicatedStorage.talkBegin.OnClientEvent:Connect(function(plr, criminal, deathMethod, name)

Now, nothing else gives an error, except the last parameter, which i try to use here

local nameDialogue1 = {
		["Prompt"] = "I don't think I ever told you, but my name is "..name..".",
		["Options"] = {"Interesting.", "Good to know.", "Stupid name."}
	}

Gives the error "Players.iiCant_Read.PlayerGui.talking.talkUi.talkScript:64: attempt to concatenate nil with string "

But “name” shouldn’t be nil…? I don’t think…?
Model
-Click Detector
–Script
So script.Parent.Parent.Name should give me the model’s name, right? So, why is it nil?

OnClientEvent doesn’t require a Player argument, you can just reference your arguments from there on

game.ReplicatedStorage.talkBegin.OnClientEvent:Connect(function(criminal, deathMethod, name)
1 Like

i had a suspicion it was something like this

Yeah, I mean if you think about it, it wouldn’t make sense to pass in the Player that fired the client if you’re doing it on a LocalScript cause you can simply just do game.Players.LocalPlayer that way (Unless of course, you’re referencing a different player)

Just make sure to keep these in mind:

Player Argument Required:

  • FireClient
  • OnServerEvent

No Player Argument Required:

  • FireServer
  • OnClientEvent

yeah, thats what i thought, i just couldnt remember which script to delete the player parameter from and i didnt wanna break something

1 Like