Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Script that slightly builds on one of Wiki's tutorials not working?

So I know basically nothing of LUA beside the small amount of time I used it for Unitale. Which was barely anything.

My "fancification" of the tutorial from here ( http://wiki.roblox.com/index.php?title=Making_a_Floating_sphere ) doesn't want to work and I don't know why. All it does is cause the outer orb ("Orb") to appear.

Also, is there a way to add ParticleEmitter to this so that it sparkles? Or change the material (or whatever I need to do to make it have a glowing outline (I was thinking Neon, but that only /kind of/ works when it's not semitransparent and it's dark))?

local LocalPlayer = game:GetService("Players").LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:wait()

local Orb = Instance.new("Part", Character)
Orb.Name = "Orb"
Orb.Shape = Enum.PartType.Ball
Orb.CanCollide = false
Orb.BrickColor = BrickColor.new("Toothpaste")
Orb.Transparency = 0.50
Orb.Size = Vector3.new(2, 2, 2)
Orb.TopSurface = Enum.SurfaceType.Smooth
Orb.BottomSurface = Enum.SurfaceType.Smooth

local Orb2 = Instance.new("Part", Character)
Orb2.Name = "Orb2"
Orb2.Shape = Enum.PartType.Ball
Orb2.CanCollide = false
Orb2.BrickColor = BrickColor.new("Industrial white")
Orb2.Transparency = 1
Orb2.Size = Vector3.new(1, 1, 1)
Orb2.TopSurface = Enum.SurfaceType.Smooth
Orb2.BottomSurface = Enum.SurfaceType.Smooth

local Weld = Instance.new("Weld", Orb2)
Weld.Part0 = Orb
Weld.Part1 = Orb2
Weld.C1 = CFrame.new(0, 0, 0)

local BodyPosition = Instance.new("BodyPosition", Orb) 

while wait(0) do
	BodyPosition.Position = Character.Head.CFrame:pointToWorldSpace(Vector3.new(2, 1, 2))
end

Help?

2 comments

1

I just tested it in studio, it works for me. Btw its Lua not LUA.

0

Again, I've barely touched Lua, so I'm not too familiar with the capitalization, especially since I've seen it as both. For some reason.

1 answer

✓ Accepted answer

Your code works; the reason why you're not seeing the inner orb is because its transparency is set to 1.

In the following code I've set the transparency to 0.5 and added a particle emitter in the inner sphere to make it sparkle :

local LocalPlayer = game:GetService("Players").LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:wait()

local Orb = Instance.new("Part", Character)
Orb.Name = "Orb"
Orb.Shape = Enum.PartType.Ball
Orb.CanCollide = false
Orb.BrickColor = BrickColor.new("Toothpaste")
Orb.Transparency = 0.50
Orb.Size = Vector3.new(2, 2, 2)
Orb.TopSurface = Enum.SurfaceType.Smooth
Orb.BottomSurface = Enum.SurfaceType.Smooth

local Orb2 = Instance.new("Part", Character)
Orb2.Name = "Orb2"
Orb2.Shape = Enum.PartType.Ball
Orb2.CanCollide = false
Orb2.BrickColor = BrickColor.new("Industrial white")
Orb2.Transparency = .5
Orb2.Size = Vector3.new(1, 1, 1)
Orb2.TopSurface = Enum.SurfaceType.Smooth
Orb2.BottomSurface = Enum.SurfaceType.Smooth

local Emitter=Instance.new('ParticleEmitter',Orb2)
Emitter.VelocitySpread=100 -- the particles go in all directions
Emitter.RotSpeed=NumberRange.new(40)

local Weld = Instance.new("Weld", Orb2)
Weld.Part0 = Orb
Weld.Part1 = Orb2
Weld.C1 = CFrame.new(0, 0, 0)

local BodyPosition = Instance.new("BodyPosition", Orb) 

while wait(0) do
    BodyPosition.Position = Character.Head.CFrame:pointToWorldSpace(Vector3.new(2, 1, 2))
end

Feel free to comment if you have questions on the answer, I'll edit it accordingly

3 comments

0

Oh goodness, I feel really stupid now. I mean, it was about 3AM while I was working on it, so it makes sense that I would make such a dumb mistake. Sorry about that, but I definitely thank you! The orb script was a bit of a "test" to see if I could add to it. I really don't know any of the functions you can use, so I just used the ones stated in the original script. Is there a list of them?

0

Is that what you're looking for @pikachu601 http://wiki.roblox.com/index.php?title=Function_dump ?

0

@Hippalectryon Pretty much, thank you.

This discussion is preserved as it was. New answers, comments, and votes are closed.