I want to be able to send the model variable defined in the server to the client.
When ever I fire to the players client the variable becomes nil. I plan to have multiple mannequins so I don’t want to individually define them in the local script.
This is the server script
local prompt = script.Parent.ProximityPrompt
local event = game.ReplicatedStorage.OutfitGui
prompt.Triggered:Connect(function(player)
local manne = script.Parent
print(manne)
event:FireClient(player, manne)
return manne
end)
This is the Local script
local event = game.ReplicatedStorage.OutfitGui
local gui = script.Parent.Frame
local ap = gui.AbsolutePosition
local tween = game:GetService("TweenService")
local icon = "http://www.roblox.com/Thumbs/Asset.ashx?width=50&height=50&assetid="
event.OnClientEvent:Connect(function(player, manne)
--print(model.Name)
gui.Position = UDim2.new(0.25, 0, -.50, 0)
gui.Visible = true
gui:TweenPosition(UDim2.new(0.25, 0, 0.25, 0), "In","Linear", .25, true)
--for i, v in pairs(game.Workspace.luvurzz:GetDescendants()) do
for i, v in pairs(manne:GetDescendants()) do
if v:IsA("Accessory") then
local id = v:FindFirstChild("AssetId")
local itemgui = game.ReplicatedStorage.ImageButton:Clone()
itemgui.Parent = gui.ScrollingFrame
itemgui.Image = icon..id.Value
end
end
end)
When the client is fired the manne variable turns to nil.