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: Remote event

Previous Thread :: Next Thread 
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
06 Apr 2015 05:28 PM
It's not working...I don't even know why.

--Server script
game.Workspace.ServerEvent.OnServerEvent:connect(function()
local Table = {["hi"] = {"lolol",1},
["hi2"] = {"lolol2",2}}
print(Table.Table[1])
end)
--Local script
game.Workspace.ServerEvent:FireServer()
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
06 Apr 2015 05:30 PM
Table.Table is nil you dip
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
06 Apr 2015 05:32 PM
I changed it into

print(Table.hi[1])

still not printing. gaah.

FE is enabled btw.
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
06 Apr 2015 05:35 PM
You made a dictionary

You have to find the value in it with the key, not the number like in an array.

Table["hi"] -->{"lolol",1}
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
06 Apr 2015 05:38 PM
Even if I replace it with:

print("test")

it won't print it. I wonder what's going on. -.-
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
06 Apr 2015 05:42 PM
help
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
06 Apr 2015 06:04 PM
I think I need to use remote function. -.-
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
06 Apr 2015 06:08 PM
^ lol
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
06 Apr 2015 06:16 PM
Still won't print. I even copied and paste roblox's example from roblox wiki (remote function) and it still won't work, I mean wtf is going on.
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
06 Apr 2015 06:23 PM
FE only works if you're a good scripter
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
06 Apr 2015 06:30 PM
game.Workspace.ServerEvent.OnServerEvent:connect(function()
local Tab = {["hi"] = {"lolol",1},
["hi2"] = {"lolol2",2}}
print(Tab.hi)
end)

??

i haven't studied up on dictionaries, so i might be wrong
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
06 Apr 2015 06:32 PM
I can script mostly anything except trying to make your game work when filtering enabled is on.
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
06 Apr 2015 06:33 PM
@insta

Even if I print anything like print("test") it won't print, especially with a remote function too!
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
06 Apr 2015 06:38 PM
if you want it to work like an array, and so you won't be as confused with remote events:

--server script

local event = game.ReplicatedStorage:WaitForChild("RemoteEvent") -- you should put remote events inside of replicatedstorage

event.OnServerEvent:connect(function()
local tab = {"hello mom!", 15, "goodbye world"}
for index, value in pairs(tab) do
print(value)
end
end)

-- local script

local event = game.ReplicatedStorage:WaitForChild("RemoteEvent")

event:FireServer()

also, just so you know, when firing to the server/client, you can provide parameters/tuples to fire as well

http://wiki.roblox.com/index.php?title=RemoteFunction_and_RemoteEvent_Tutorial
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