generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Simple RemoteEvent problem

Previous Thread :: Next Thread 
Elandorr is not online. Elandorr
Joined: 25 Sep 2015
Total Posts: 148
30 Sep 2015 04:30 PM
Just started trying to learn remoteEvents and stuff, I get this error: Arguement 1 missing or nil. Here are the scripts;

First script, in serverScriptService in Normal Script,
-------------------------------------------------
for i,v in pairs (game.Players:GetPlayers()) do
if v:WaitForChild("PlayerScripts"):FindFirstChild("Starting"):FindFirstChild("DisplayMessage") then
print("i")
v.PlayerScripts.Starting.DisplayMessage:FireClient()
end
end
--------------------------------------------------
Second script, in starterPlayerScripts, in local script with RemoteEvent called "DisplayMessage inside of it".

player = game.Players.LocalPlayer

local messageGui = player:WaitForChild("PlayerGui"):WaitForChild("MessageGui")
local message = messageGui:WaitForChild("Message")
local displayMessage = script:WaitForChild("DisplayMessage")

displayMessage.OnClientEvent:connect(function()
message.Text = "Game Is Starting"
end)

Report Abuse
Elandorr is not online. Elandorr
Joined: 25 Sep 2015
Total Posts: 148
30 Sep 2015 04:31 PM
Oh the error is on the line below print("i")
Report Abuse
morashsPeasant is not online. morashsPeasant
Joined: 06 Jan 2011
Total Posts: 4944
30 Sep 2015 04:31 PM
You have to tell the server which player to fire the event to.
remoteEvent:FireClient(player)

morashsPeasant is n0 sk0p1ng
Report Abuse
Elandorr is not online. Elandorr
Joined: 25 Sep 2015
Total Posts: 148
30 Sep 2015 04:34 PM
Ty! Anything else I should be aware of with Remote stuff. First time using it.
Report Abuse
FrontPocket is not online. FrontPocket
Joined: 27 Apr 2014
Total Posts: 278
30 Sep 2015 04:37 PM
Note: when using RemoteFunctions, you cant return instances that arent parented to anything.

For example:

local prt = Instance.new("Part")
prt.Name = "Yay"
return prt


That wont work.
You will have to parent it to something (lighting works) and then remove it later.


(Also note I might be wrong about this, but in the past Ive had to parent Instances)
Report Abuse
Elandorr is not online. Elandorr
Joined: 25 Sep 2015
Total Posts: 148
30 Sep 2015 04:39 PM
Ty. So should I be using Remote stuff to be able to access player from serverScripts such as changing Gui's or give tools?
Report Abuse
FrontPocket is not online. FrontPocket
Joined: 27 Apr 2014
Total Posts: 278
30 Sep 2015 04:43 PM
Yes.
But keep in mind that the client can read from the server, but not make changes.
So, you dont need a whole remote event/function cycle to get the size of a brick in workspace.

A local script can reference anything as long as it doesn't make changes.

The same can't be said for a server script.
If you want the server to make changes to GUIs youll have to have an event.
But the server can move characters and change leaderstats, as they are in the server.
Report Abuse
Elandorr is not online. Elandorr
Joined: 25 Sep 2015
Total Posts: 148
30 Sep 2015 04:45 PM
Ok, ty. I'm making a game and since my coding works but is very poorly coded and very glitchy Im trying to improve it
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image