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
 

RemoteEvents not allowing to fire args correctly

Previous Thread :: Next Thread 
gmatch is not online. gmatch
Joined: 21 May 2014
Total Posts: 1173
03 Dec 2017 12:08 PM
-- Script
local ss = game:GetService("ServerStorage")
local event = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")

game.Players.PlayerAdded:connect(function(player)
local folder = Instance.new("Folder")
folder.Name = player.Name
folder.Parent = ss

folder.ChildAdded:connect(function(object)
print(object.Name)
local asset = game:GetService("ReplicatedStorage").Parts:FindFirstChild(object.Name)
if asset then
event:FireClient(player, object.Name, 10)
end
end)
end)

-- Local script

local event = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")
local frame = script.Parent.Frame

event.OnClientEvent:connect(function(player, object, amount)
print(player, object, amount)
end)

Why does the "amount" return nil?


Report Abuse
gmatch is not online. gmatch
Joined: 21 May 2014
Total Posts: 1173
03 Dec 2017 12:47 PM
b


Report Abuse
gmatch is not online. gmatch
Joined: 21 May 2014
Total Posts: 1173
03 Dec 2017 08:48 PM
b


Report Abuse
libpng is not online. libpng
Joined: 03 Sep 2017
Total Posts: 20
03 Dec 2017 08:54 PM
event.OnClientEvent:connect(function(object, amount)
Report Abuse
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
03 Dec 2017 08:56 PM
post the output
Report Abuse
Exzeption is not online. Exzeption
Joined: 01 Nov 2011
Total Posts: 1312
03 Dec 2017 08:58 PM
.OnClientEvent doesn't give player. You only need that for :FireClient
Report Abuse
gmatch is not online. gmatch
Joined: 21 May 2014
Total Posts: 1173
03 Dec 2017 09:10 PM
Holy.. I'm stupid. Took me a day to figure that out. Thanks ex


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