-- 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?
|