game.ReplicatedStorage.build.OnServerEvent:connect(function(player,color,
building,translation)
--repeat wait() until building
local buil = building:Clone()--clone cause reason
for i,v in pairs(buil:GetChildren()) do
if v.Name == "Recolor" then--recolor
v.BrickColor = BrickColor.new(color.Color)--color is the players teamcolor
end
end
spawn(function()_G.build(buil,25,30)end)--a function that works
buil:TranslateBy(translation)--translate, cause yea
wait()--because reasons
buil.Parent = game.Workspace
end)
It works fine in studio, but in player, it says in the console something about building being nil. When I uncomment line 3, it never goes. I assume it stops there forever. building is a model btw, and I really don't know why this isn't working. I fire it from this:
game.ReplicatedStorage.build:FireServer(color,sendB,toTranslate)--sendB is the model

6 comments
Edit this to show where you fire this event, please.
done
My bad, not too experienced with remote events and functions
I mean, if you haven't, you might as well try it.
Tried it, got this Clone is not a valid member. Probably because you can't clone a color.
You deleted the answer! LOL