Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

InsertSevice and Instance.new Problems?

Asked by 10 years ago

Which one would work? If neither will, how do I make it so that it will?

game.Workspace.MUSHR0OM.Humanoid.Head.Mesh:remove()
h = game.Instance.new("CylinderMesh")
s = game.Instance.new("Sparkles")
o = game.Instance.new("OutlineBox")
game.Workspace.MUSHR0OM.Humanoid.Head == h
game.Workspace.MUSHR0OM.Humanoid.Head == s
game.Workspace.MUSHR0OM.Humanoid.Head == o
end



game.Workspace.MUSHR0OM.Humanoid.Head.Mesh:remove()
h = game.Instance.new("CylinderMesh")
s = game.Instance.new("Sparkles")
o = game.Instance.new("OutlineBox")
game:GetService("InsertService")
game.Workspace.MUSHR0OM.Humanoid.Head:InsertService(h)
game.Workspace.MUSHR0OM.Humanoid.Head:InsertService(s)
game.Workspace.MUSHR0OM.Humanoid.Head:InsertService(o)
end
end
end

1 answer

Log in to vote
5
Answered by
Ekkoh 635 Moderation Voter
10 years ago
  1. First line looks good
  2. You never opened a scope so you don't need to close it with an end
  3. Instance is a global variable, you can't say game.Instance.new

This is probably what you were going for-

local head = Workspace.MUSHR0OM:WaitForChild("Head") -- I'd make a variable for your head
head:FindFirstChild("Mesh"):Destroy() -- remove old mesh
local cylmsh = Instance.new("CylinderMesh") -- creates cylinder mesh
local spark = Instance.new("Sparkles") -- creates sparkles
local box = Instance.new("SelectionBox") -- creates selection box
cylmesh.Parent = head -- puts cylinder mesh into head
spark.Parent = head -- puts sparkles into head
box.Parent = head -- puts selection box into head
1
EXACTLY WHAT I WAS TRYING TO DO! :D You my friend, get rep c: MUSHR0OM 0 — 10y
0
Glad I could help c: Ekkoh 635 — 10y
1
ekkoh CAn you thumbs me up? MUSHR0OM 0 — 10y
0
Mhmm Ekkoh 635 — 10y
0
Someone thumbs downed everything I said. I had 13 now I have 0. :CCC MUSHR0OM 0 — 10y
Ad

Answer this question