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

Problem With My Hide Name GUI, Please help? [closed]

Asked by
M39a9am3R 3210 Moderation Voter Community Moderator
10 years ago

The transparencies are working fine, it's just that whenever I click the button it will kill me (at least right now I know how to make a reset button). Can anyone find my problem?

local nameshowing=true
local fakehead=script.Parent.Parent.Parent.Parent.Character.Head:Clone()
local plr=script.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Click:connect(function()
local shouldhidename = true
if nameshowing == true then
shouldhidename = true
else shouldhidename=false
end
if shouldhidename==true then
    if plr.Character ~=nil then
    if plr.Character:FindFirstChild("Head") then
        plr.Character.Head.Transparency=1
        fakehead.Parent=plr.Character
        fakehead.Name = "FakeHead"
        fakehead.CFrame=plr.Character.Head.CFrame
        w=Instance.new("Weld",plr.Character.Head)
        w.Part0 = plr.Character.Head
        w.Part1 = fakehead
        nameshowing = false
    end
    end
else
    fakehead.Transparency = 1
    plr.Character.Head.Transparency = 0
    nameshowing=true
end
end)

Any help will be appreciated, thanks for your time.

Locked by M39a9am3R, adark, SanityMan, and TheMyrco

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

3 answers

Log in to vote
-3
Answered by 10 years ago

Try this one :

http://www.roblox.com/Hide-Name-Script-But-not-your-head-12-03-27-item?id=75938567

Please Upvote this if i helped :)

Ad
Log in to vote
4
Answered by 10 years ago

Why did you make a script inside another thing? You need to create a LocalScript in some storage service, then clone it in the playergui and execute the function in your mouse script, kinda like this:

_G.hideBillboard = function()
    local player = game.Players.LocalPlayer
    local fakeHead = player.Character.Head:Clone().Parent(player.Character)
    fakeHead.Name = "FakeHead"
    player.Character.Head.Transparency = 1
    player.Character:WaitForChild("FakeHead") -- Wait for the FakeHead to be loaded
    local weld = Instance.new("Weld") 
    weld.Parent = player.Character.Head
    weld.Part0 = player.Character.Head
    weld.Part1 = player.Character.FakeHead
end

_G.unhideBillboard = function()
    -- Opposite of hideBillBoard()
end

After you can call those method outside everything:

function onMouseClick()
    -- I suppose that you have a boolean called "hidden" that checks if the game needs to hide/unhide the billboard
    if hidden then 
        _G.unhideBillboard()
    else
        _G.hideBillboard()
end
0
The script is inside the button inside a screengui, inside the startergui, which is inside the player so there are four parents. I think my problem here is the welds. But does it need to be inside a localscript in order for it to work? M39a9am3R 3210 — 10y
0
I edited the message alessandro112 161 — 10y
0
Just moved my code to a LocalScript, thank you. M39a9am3R 3210 — 10y
0
No problem ;) alessandro112 161 — 10y
Log in to vote
-1
Answered by 10 years ago

Would it have been possible to rename your humanoid to nothing so the name doesn't show up? Just wondering.

0
No, it is not possible. Since your character is connected to your player I guess that makes your character's name ROBLOX locked, since I've tried changing it in two ways in studio one being script and the other being through properties with no change. M39a9am3R 3210 — 10y
0
Ok thanks! Mind checking my most recent question? Champion121212 22 — 10y