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

[HELP] How would I define the localplayer?

Asked by 7 years ago

Okay. So, I made a Self-Check-in system, and I want it to send a message to the User with their Flight Number, and their Seat Number. I can not seem to get it to send it to the User who clicks the button. Let me show you.

local FlightNumber = "1132"
local Airline = "KAL"
local player = game.Players.LocalPlayer
local server = require(script.Parent.Server)
local domain = "HIDDEN" -- Make sure there is no http:// in here!
local key = "HIDDEN"
local userId = game:GetService("Players"):GetUserIdFromNameAsync(player)
local api = server(domain, key)

script.Parent.MouseButton1Click:connect(function()
    print(api.message(userId, 'Subject', 'Body').message)
end)    

I want it to send to the person who clicks on the Confirm Button, but it just doesn't seem to work. I already defined my local player, and everything. Please assist me. Thanks!

0
FlgithNumber, Airline, and "key" aren't used anywhere in your code/ don't appear to be correctly "defined." What's the purpose of them if you don't use them? TheeDeathCaster 2368 — 7y
0
I removed them for the purpose of the question. jam10161 13 — 7y
0
Clients are not allowed to use HTTPService nor DataStores. You will need to transmit the information using RemoteEvents. There is a tutorial for those here: http://wiki.roblox.com/index.php?title=RemoteFunction_and_RemoteEvent_Tutorial chess123mate 5873 — 7y
0
Is there any reason you cant just use > local userId=player.UserId ?? XtremeSpy 80 — 7y

Answer this question