Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

i am STILL confused? everything should be right? SOLVED

Asked by 2 years ago
Edited 2 years ago

THE PROBLEM HAS BEEN FIXED

0
i sent 3 of the same question and got alot of help, but it still wont work? hudstir 0 — 2y
0
What are you trying to script? It would be helpful if we knew what you are trying to do here? theking66hayday 841 — 2y
0
there hudstir 0 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

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

0
it didnt even print? hudstir 0 — 2y
Ad

Answer this question