Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

i am STILL confused? everything should be right? SOLVED

THE PROBLEM HAS BEEN FIXED

3 comments

0

i sent 3 of the same question and got alot of help, but it still wont work?

0

What are you trying to script? It would be helpful if we knew what you are trying to do here?

0

there

1 answer

In local script line 9, you don't need to send the player to the server, just send the message. Connecting the remote event in the server will automatically return the client/player that fired the remote event.

kickplayer:FireServer("you got all the items on the shopping list!")

The reason why it wasn't working was because instead of message being the message you sent, it's the player.

This won't work

-- kickplayer:FireServer(player, "you got all the items on the shopping list!")

kickplayer.OnServerEvent:Connect(function(player, message)
	if typeof(message) == "string" then
		print("it's a string")
	else
		print("it's not a string") -- this will print because you sent the player before the message in the remote event
	end
end)

This will work

-- kickplayer:FireServer("you got all the items on the shopping list!")

kickplayer.OnServerEvent:Connect(function(player, message)
	if typeof(message) == "string" then
		print("it's a string") -- this will print because you only sent the message and not the player
	else
		print("it's not a string")
	end
end)

sorry for bad explanation T-T

1 comment

0

it didnt even print?

This discussion is preserved as it was. New answers, comments, and votes are closed.