|
| 03 Jul 2016 07:09 AM |
tool = script.Parent
event = tool:FindFirstChild("RemoteEvent")
event.OnServerEvent:connect(function(player, ...) local tuple = {...} if tuple[1] == "FIRE" then print("Server has been fired!") end end)
more importantly It was working 5 minutes ago, I have no idea what is going on. |
|
|
| Report Abuse |
|
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
|
| 03 Jul 2016 07:13 AM |
if you are giving ... as a table, you dont need to make it another one
...(Given) tuple = {...}
then it might be
{{...}} |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2016 07:19 AM |
| oh sorry it isn't tuple that is nil, it's the variable event |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2016 07:36 AM |
for some reason removing this block
event.OnServerEvent:connect(function(player, ...) local tuple = {...} if tuple[1] == "FIRE" then print("Server has been fired!") end end)
sets event to nil for some reason, is there something wrong with the way I set it up? |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2016 08:03 AM |
local Tool = script.Parent local Event = Tool:FindFirstChild("RemoteEvent") Event.OnServerEvent:connect(function(Player, ...) local Arguments = {...} print(Player) for Position, Argument in next, Arguments do if Argument[1] == Argument[Position] and Argument == "FIRE" then print("Server has been fired!") break end end end)
-=[ RAP: 334,746 || DurstAuric; the narb of ROBLOX ]=- |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2016 08:13 AM |
| ^ If it still nils, change in FindFirstChild to WaitForChild. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 03 Jul 2016 09:29 AM |
--Server script
local re = game.ReplicatedStorage:WaitForChild("RemoteEvent") local tool = script.Parent
re.OnServerEvent:connect(function(plr,...) local tuple = {...} if tuple[1] == "FIRE" then print("Server has been fired!") end end)
--Local script
local re = game.ReplicatedStorage:WaitForChild("RemoteEvent")
re:FireServer("FIRE","HELLO","YO")
|
|
|
| Report Abuse |
|
|
|
| 03 Jul 2016 10:01 AM |
WaitForChild did it, thanks
it probably wasn't loaded yet when the script ran |
|
|
| Report Abuse |
|
|