|
| 25 Jun 2016 09:36 PM |
Ok, so I'm trying to make this dialog FireClient in the player. It works successfully on studio, but when I test it in the server, it says LocalEvents becomes nil. Even when I add waitforchild, the script just stops working, please help.
local Dialog = script.Parent local DialogEvent = Dialog:WaitForChild("DialogEvent") DialogEvent.OnServerEvent:connect(function(Player, Choice) if (Choice == Yes) then Player.leaderstats.Career.Value = "Blue Noob" Player.PlayerGui.LocalEvents.JoinedBlueNoobs:FireClient(Player)
end)
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
|
| 25 Jun 2016 10:26 PM |
| *Coughs Coughs Coughs Coughs* |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 10:29 PM |
| *Coughs Coughs Coughs Coughs Coughs* |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 10:32 PM |
| *Coughs Coughs Coughs Coughs Coughs Coughs* |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 10:37 PM |
| Is this script in a local script? or a regular script? |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 10:56 PM |
| This is in a regular script, since it's a dialog for NPCs. |
|
|
| Report Abuse |
|
|
| |
|
|
| 25 Jun 2016 11:51 PM |
| Put a print statement directly below the connection to the event. After you do that, go into your game in a live server. Make the event fire and then tell me if it printed it or not. |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 11:55 PM |
| It errors because the event can't reach to connect and FireClient. |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2016 12:01 AM |
I don't really understand what you just said but w/e. The issue is somewhere below.
- You're missing an end (for the if statement) - That event can only be connected to via a local script if FE is on. - 'Yes' is probably a variable that you didn't show us but just in case it isn't, the returned choice is the location of the dialog that was selected, - Don't put the RemoteEvent in the player. Instead, put the event in the ReplicatedStorage (which can be accessed locally). |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2016 12:14 AM |
Nobody should help you. You're being impatient and rude and think you're entitled to get free help RIGHT this instant.
|
|
|
| Report Abuse |
|
|
|
| 26 Jun 2016 12:59 AM |
Tip for the future: Test the majority of things in your in a test server
|
|
|
| Report Abuse |
|
|
|
| 26 Jun 2016 02:47 AM |
| Ok, I'll put event in replicatedsroragge, thanks |
|
|
| Report Abuse |
|
|