#Bug on head
1 messages · Page 1 of 1 (latest)
(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)
Are the parts anchored
Anchor them
aight
You're using the same weld to weld both parts to the head, causing the previous one to be invalid
Create two weld instances, instead
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?
like it spawns VERY VERY back at ur head or just falls off
The falling off would be due to improper welds, which this should fix
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
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
oh thank you! i know whats the issue really but i dont know the code
i can just imagine the code not write it
replace
local red = script.Halo.REDD:Clone()
with
local red = halo.REDD
the original halo is this
but the halo spawns in the middle of my head
do i just adjust its REDD.Position
Wait, where do you want the halo to spawn?
over the head..
Then yeah, just adjust the position of both
also one last thing
how do i make the halo user id exclusive
PlayerAdded.UserID = "" ?
idk lol
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
how do i do :sob;
like
game.Players.PlayerAdded.UserID = "x" then
(idk) else
(idk)
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
then, directly under the line that says
game.Players.PlayerAdded:Connect(function(plry)
do
if not table.find(ownerIds, plry.UserId) then return end
thats it?
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
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
Do you mean a text label that shows up above the player?
** You are now Level 7! **
ye but only for owner
Yeah, that's doable. Just use a billboard gui with a text label in it
Change of plans