|
| 11 Nov 2015 05:49 AM |
I have a code: local background = script.Parent.BG local text = background.Text
game.Lighting.Fire.OnServerEvent:connect(function(player, message, over) if over == false then text:TweenPosition(UDim2.new(0, 0,0.5, -50)) text.Text = message end if over == true then text:TweenPosition(UDim2.new(0, 0,-0.5,0)) text.Text = "" end end)
I need help, this is in a regular script in a gui, which everyone gets and I want it so I can simply put game.Lighting.Fire:FireAllClients("MSG", true/false) and it'll show up on everyones screens, any reason it is not working? I've tinkered so many different settings with it. The error I get with this version is nothing. Nothing appears in the output at all. Please help! |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2015 06:22 AM |
BUMP#1 UPDATE
So, I've changed the script a little, it is a local script now. Still in the gui! The remote event it calls is in the lighting. Once again this is a local script inside of the player's GUI: local background = script.Parent.BG local text = background.Text
game.Lighting.Fire.OnClientEvent:connect(function(message, over) if over == false then text:TweenPosition(UDim2.new(0, 0,0.5, -50)) text.Text = message end if over == true then text:TweenPosition(UDim2.new(0, 0,-0.5,0)) text.Text = "" end end)
This is how I fire the RemoteEvent from a normal script in the workspace: game.Lighting.Fire:FireAllClients("This game requires 2 players to play, sorry!", false)
It works in solo networking but in the real client the game runs like the messages are popping up, but they are not. Errors I get: |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2015 07:37 AM |
"It works in solo networking but in the real client the game runs like the messages are popping up" - when are you showing the message, if it's as soon as someone connects then it's likely it'll be missed by the real client. You could try adding a wait in your script just as a test.
|
|
|
| Report Abuse |
|
|
Ben1925
|
  |
| Joined: 07 Apr 2011 |
| Total Posts: 741 |
|
|
| 11 Nov 2015 08:02 AM |
I remember doing something like this (And it did work)
I did something like this:
Remote Event is @ game.Workspace.RemoteEvents.notifyClient -- Does exactly what you think it does
-- Server Script (Script inside Workspace)
local event = workspace.RemoteEvents.notifyClient event:FireAllClients("Hello hello message here", 4) -- 4 is for the timeout.
-- Client Script (LocalScript in a TextButton inside the StarterGui)
local event = workspace.RemoteEvents.notifyClient
event.OnClientEvent:connect(function(notif, timeout) script.Parent.Text = notif wait(1) script.Parent:TweenPosition(UDim2.new(0.03,0,0.8,0)) -- Moves to visible area wait(timeout) script.Parent:TweenPosition(UDim2.new(0.03,0,1,0)) -- Moves to edge (So it can't be seen) end)
|
|
|
| Report Abuse |
|
|
Dogejia
|
  |
| Joined: 08 Feb 2012 |
| Total Posts: 1873 |
|
|
| 11 Nov 2015 09:09 AM |
Try moving the remoteevent to the replicatedstorage
Dogemon, gotta pet them all! |
|
|
| Report Abuse |
|
|