I'm trying to clone a model of Replicated Storage to Workspace when the player collides with a part, but when I test it on the Roblox Client, the code not work.
Script inside the part:
local remoto = game.ReplicatedStorage.Torre2
local dinero = "Money"
local Money = script.Parent.Parent.Collect
local boton = game.Workspace.Job1.Boton1
script.Parent.Touched:Connect(function(hit)
local h = hit.Parent:FindFirstChild("Humanoid")
if h then
local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
if Player and Player.leaderstats[dinero].Value >= 200 then
Player.leaderstats[dinero].Value = Player.leaderstats[dinero].Value - 200
remoto:FireServer()
boton:Destroy()
end
end
end)
Script inside Workspace:
game.ReplicatedStorage.Torre1.OnServerEvent:Connect(function()
local Modelo1 = game.ReplicatedStorage.FreeMachine
local Clonar = Modelo1:Clone()
Clonar.Parent = game.Workspace.Job1
Clonar.Name = "TorreGratis"
end)
game.ReplicatedStorage.Torre2.OnServerEvent:Connect(function()
local Modelo1 = game.ReplicatedStorage.MachineLV1_J1_P1
local Clonar = Modelo1:Clone()
Clonar.Parent = game.Workspace.Job1
Clonar.Name = "TorreLV1"
end)
I think is a problem using a Remote Event, because when I test it on Roblox Studio, I can clone the model "MachineLV1_J1_P1" but I don't know how to fix it to make it work in the roblox client.
Thanks for read me.

1 comment
but y r u even using a remote.