I have a button that should spawn a human on a part named "Hspawn" When i press it the sounds go off and everything although no human spawns. Here's the script:
room = script.Parent.Parent.Parent.Parent enums = {"Doug","Jhonatam","Johan","Rob","Robson","Hiron","Kleb","Kurt","Fernand","Jefferson","Jackson","Jake","Jack","Mason","Jamal","Mateo","Noah","Lucas","David","Albert","George","Nicholas","Gabriel","Peter","Alfred","Josef","Erick","Dylan","John","Gustav","Richard","Ron","June"} enums2 = {BrickColor.new("Pastel brown"),BrickColor.new("Brick yellow"),BrickColor.new("Pine Cone"),BrickColor.new("Dirt brown"),BrickColor.new("Wheat")} script.Parent.ClickDetector.MouseClick:connect(function() if not room.Human:FindFirstChildOfClass("Model") then local color = enums2[math.random(1,#enums2)] script.Parent.Sound:Play() local human = game.Lighting.Human:Clone() for i,v in pairs(human:GetChildren()) do if v:IsA("Part") then v.BrickColor = color end end human.Name = enums[math.random(1,#enums)] human.Parent = room.Human human:MakeJoints() human.HumanoidRootPart.CFrame = room.Hspawn.CFrame wait(0.5) room.Ground.hit:Play() end end)
am i missing something?
Closed as Too Broad by ScriptGuider
This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.
Why was this question closed?