generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

How can I convert my localscript into a script?

Previous Thread :: Next Thread 
TheTeamGame is not online. TheTeamGame
Joined: 25 Jul 2014
Total Posts: 26
28 Jul 2014 02:56 PM
I made a script that creates a billboard GUI that floats above your head, but I forgot that its a local script and didn't realize until a friend told me he couldn't see the GUI above my head.

Can someone show me how to convert this into a regular script?

player = game.Players.LocalPlayer
character = player.Character

script.Parent.FocusLost:connect(function()
local bg = Instance.new("BillboardGui")
bg.Parent = character.Head
bg.Size = UDim2.new(1, 0, 1, 0)
bg.StudsOffset = Vector3.new(0, 2, 0)
local frame = Instance.new("Frame")
frame.Parent = bg
frame.Size = UDim2.new(1, 0, 1, 0)
frame.BackgroundTransparency = 1
local text = Instance.new("TextLabel")
text.Parent = frame
text.Position = UDim2.new(0.25, 0, 0.25, 0)
text.Size = UDim2.new(0.5, 0, 0.5, 0)
text.Text = script.Parent.Text
text.BackgroundTransparency = 1
text.TextColor3 = Color3.new(1, 1, 1)
text.Font = "ArialBold"
text.FontSize = "Size24"
end)
Report Abuse
Locard is not online. Locard
Joined: 13 Apr 2014
Total Posts: 3516
28 Jul 2014 02:59 PM
You can't convert it into a script, however there is such a thing as copy and paste.

Even so, it would still not work.
Report Abuse
TheTeamGame is not online. TheTeamGame
Joined: 25 Jul 2014
Total Posts: 26
28 Jul 2014 03:01 PM
Oh, I was thinking I could considering it was a simple line that was blocking me from a regular script.

"player = game.Players.LocalPlayer"

Is there an alternative to LocalPlayer that works in a regular script?
Report Abuse
Locard is not online. Locard
Joined: 13 Apr 2014
Total Posts: 3516
28 Jul 2014 03:06 PM
Try using events to get the person that just entered.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image