Hi, I am trying to find a Model in ServerStorage. I am doing :FireServer("FishingMachine") in a Local Script in StarterGui, and the server script detects the OnServerEvent and trys to find the "FishingMachine" in serverstorage. I am trying this by doing this:
local Event = game.ReplicatedStorage.GiveDropper
Event.OnServerEvent:Connect(function(data)
if game.ServerStorage:FindFirstChild(data.Name) then
print("Found")
local Cloned = game.ServerStorage:FindFirstChild(data.Name):Clone()
Cloned.Parent = game.Workspace
end
end)
In the script that fires the event, it looks like this:
local Button = game.Workspace.Button
local Gui = game.Players.LocalPlayer.PlayerGui:WaitForChild("MainGui"):WaitForChild("NoCash")
local Event = game.ReplicatedStorage.GiveDropper
game.Workspace.Button.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local Cash = game.Players.LocalPlayer:FindFirstChild("leaderstats"):FindFirstChild("Cash")
if Cash.Value >= 50 then
Button:Destroy()
Cash.Value = Cash.Value - 50
game.Workspace.BoughtSound:Play()
Event:FireServer("FishingMachine")
print("Fired")
else
Gui.Visible = true
wait(1.2)
Gui.Visible = false
end
end
end)
Ive tried this:
local Event = game.ReplicatedStorage.GiveDropper
Event.OnServerEvent:Connect(function(player,data)
if game.ServerStorage:FindFirstChild(data.Name) then
print("Found")
local Cloned = game.ServerStorage:FindFirstChild(data.Name):Clone()
Cloned.Parent = game.Workspace
end
end)
but says 'Argument 1 missing or nil' in the Output. It doesnt seem to find it. What else should i try and do?? I have checked for spelling mistakes and found none, in the script and the Model in ServerStorage. Thanks.

1 comment
Still doesnt work.