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.
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
Would it have been possible to rename your humanoid to nothing so the name doesn't show up? Just wondering.
Try this one :
Please Upvote this if i helped :)