#Bug on head

1 messages · Page 1 of 1 (latest)

steep vigil
#

Basically i have made a halo script for devs only but theres 2 issues. Theres a little part at the top of the halo but even tho i welded it, it falls of or glitches. Secondly, i don't know how to make it devs (or lists of ids) only.

#

(Halo model)

Halo

  • Script (ignore, it makes it rainbow)
  • REDD (Red part top of the halo)
  • WeldConstaint (Part0 = Halo, Part1 = REDD)
#

SCRIPT TO MAKE HALO GO ON TOP OF THE PLAYER

game.Players.PlayerAdded:Connect(function(plry)
plry.CharacterAdded:Connect(function(chr)
repeat wait() until chr:FindFirstChild("Head")

    local halo = script.Halo:Clone()
    local red = script.Halo.REDD:Clone()
    red.Parent = chr.Head
    halo.Parent = chr.Head
    
    local weld = Instance.new("WeldConstraint")
    weld.Parent = chr.Head
    weld.Part0 = chr.Head
    weld.Part1 = halo
    weld.Parent = chr.Head
    weld.Part0 = chr.Head
    weld.Part1 = red
    
    halo.Position = chr.Head.Position + Vector3.new(0, 1, 0)
    red.Position = chr.Head.Position + Vector3.new(0, 1, 0)
end)

end)

#

** Theres no errors but whenever i press play, the REDD glitches. It doesnt connect to the halo even tho i welded it so i want the REDD to stay intact like the halo **

#

(Also if possible, can i make the halo only spawn on a specific player id? If i can, i dont really know i would appreciate it if you help)

steep vigil
#

no

#

all of em are unanchored

storm tundra
#

Anchor them

steep vigil
#

k hol on

#

no??? why would i anchor

#

and it didnt work

storm tundra
#

Oh

#

I’m gonna shower I’ll be on in like 10-30 mins

steep vigil
#

aight

grave notch
#

Create two weld instances, instead

steep vigil
#

soo

#

i did that before tho

#

it just glitches

grave notch
#

local weld = Instance.new("WeldConstraint")
weld.Parent = chr.Head
weld.Part0 = chr.Head
weld.Part1 = halo

local weld2 = Instance.new("WeldConstraint")
weld2.Parent = chr.Head
weld2.Part0 = chr.Head
weld2.Part1 = red
#

Could you explain what you mean by glitching?

steep vigil
#

i did smth really close to this

#

i forgot to add weld2 tho

steep vigil
grave notch
#

The falling off would be due to improper welds, which this should fix

steep vigil
#

aight

#

basially

#

the first REDD worked

#

i can adjust its position

#

but

#

theres another REDD at the very back

#

let me send rq

#

its very far

#

u can see one in the middle

#

but theres another one in the back

#

i couldnt get rid of

#

sorry man im not the best of scripting, building is a thing i do more

grave notch
#

Oh, I know why it's like that

#

You're cloning the halo, which is the parent of the REDD part, but then you're also cloning the REDD part itself, which creates a second one

#

this is a simple fix

steep vigil
#

i can just imagine the code not write it

grave notch
#

replace

local red = script.Halo.REDD:Clone()

with

local red = halo.REDD
steep vigil
#

les see

#

fixed the issue

#

but theres 2 more stuff

steep vigil
#

but the halo spawns in the middle of my head

#

do i just adjust its REDD.Position

grave notch
#

Wait, where do you want the halo to spawn?

steep vigil
#

over the head..

grave notch
#

Then yeah, just adjust the position of both

steep vigil
#

also one last thing

#

how do i make the halo user id exclusive

#

PlayerAdded.UserID = "" ?

#

idk lol

grave notch
# steep vigil how do i make the halo user id exclusive

That's not too hard, just create a table containing a list of user ids that you want to get the halo, and use table.find() to search that table for the joining players userid, and if it doesn't match, don't continue the rest

steep vigil
#

how do i do :sob;

#

like

#

game.Players.PlayerAdded.UserID = "x" then
(idk) else
(idk)

grave notch
#

First, you need it to define a table which is just a list of the player ids you want to give it. So add something like this to the top:

local ownerIds = {

playersid,
otherplayersid,
etc

}
#

replace the "playerid" and stuff with the ids of people you want to have the halo

steep vigil
#

aight

#

did it

grave notch
#

then, directly under the line that says

game.Players.PlayerAdded:Connect(function(plry)

do

if not table.find(ownerIds, plry.UserId) then return end
steep vigil
#

thats it?

grave notch
#

this should check that owner list for the player who joined's user id, and if it doesn't find it, it won't create the player.CharacterAdded, and therefore won't spawn a halo for them

#

You can test to make sure it works by adding and removing your own userid to the list

steep vigil
#

aight one sec

#

wont take long

#

yes!

#

it worked

#

well

#

if u arent busy

#

this is a really simple thing

#

if u wanna go u can

#

but can i make the same thing with a textllabel on top of the ownerIds

grave notch
#

Do you mean a text label that shows up above the player?

stark flaxBOT
#

studio** You are now Level 7! **studio

steep vigil
grave notch
#

Yeah, that's doable. Just use a billboard gui with a text label in it

steep vigil
#

aight

#

ty

#

thank you for ur time

storm tundra
#

Change of plans