Hi, there!
I have a problem, Script will work in studio and not in the real game.
--// This is a localscript! local bill = game:GetService("ServerStorage"):WaitForChild("crobras") script.Parent.MouseButton1Down:connect(function() local plr = game:GetService("Players").LocalPlayer.Character local clonedgui = bill:Clone() print("works") clonedgui.Parent = game.Workspace[plr.Name].Head script.Parent.Parent:Destroy() end)
Need help! :)
Server Storage only goes to the server, like the name implies. Instead, use ReplicatedStorage. Also, READ MY BIO!
Okay, so I guess you're trying to make a custom name ontop of the player's head by clicking a GUI.
To me, it's easier by putting the BillboardGui somewhere inside the ScreenGui. BillboardGui only works when it's inside a Part
This is the recreated version of your script:
-- this local script must be inside ScreenGui local plr = game.Players.LocalPlayer local b1 = script.Parent.Parent:WaitForChild('BillboardGui') script.Parent.MouseButton1Click:connect(function() local b2 = plr.Character.Head:FindFirstChild('BillboardGui') if b2 then -- if the Billboard is already inside, it will destroy and replace the new one b2:Destroy() wait(.1) b1:Clone().Parent = plr.Character.Head print('cloned') else -- if the Billboard isn't inside, it will clone and put inside the player's head b1:Clone().Parent = plr.Character.Head print('cloned') end end)
LocalScript, using ServerStorage? You see what doesn't work there?