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
 

Re: Text not resizing

Previous Thread :: Next Thread 
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
24 May 2014 10:12 PM
local GuestNoteFunc = game:GetService("ReplicatedStorage"):WaitForChild("Functions"):WaitForChild("GuestNotification")
local FriendNote = script:WaitForChild("FriendNote")
local FriendAcceptNote = script:WaitForChild("FriendAcceptNote")

function GuestNoteFunc.OnClientInvoke()
_G.GuestNote.Visible = true
end

_G.GuestNote:WaitForChild("Accept").MouseButton1Click:connect(function()
_G.GuestNote.Visible = false
end)

function game.Workspace.FriendHandler.SendFriendRequest.OnClientInvoke(Sender)

local Note = FriendNote:Clone()
Note.Display.Text = Sender.Name.." has sent you a Friend Request"
Note.Parent = _G.HUD

Note:WaitForChild("Accept").MouseButton1Click:connect(function()
Note:Destroy()
game.Workspace.FriendHandler.FriendRequestStatus:InvokeServer(Sender, true)
end)

Note:WaitForChild("Decline").MouseButton1Click:connect(function()
Note:Destroy()
game.Workspace.FriendHandler.FriendRequestStatus:InvokeServer(Sender, false)
end)

end

function game.Workspace.FriendHandler.FriendRequestStatus.OnClientInvoke(Receiver, Accept)

local Note = FriendAcceptNote:Clone()
local Capture = Note:WaitForChild("Capture")
local Display1 = Note:WaitForChild("Display1")
local Display2 =Note:WaitForChild("Display2")
local Display3 = Note:WaitForChild("Display3")

Display1.Text = Receiver.." has "

if Accept then
FriendAcceptNote.Header.Text = "Friend Request Accepted"
Display2.Text = "accepted "
Display2.TextColor3 = Color3.new(0, 153/255, 0)
else
FriendAcceptNote.Header.Text = "Friend Request Declined"
Display2.Text = "declined "
Display2.TextColor3 = Color3.new(223/255, 0, 0)
end

--[[THESE LINES]]
print(Display1.TextBounds.X)
Display1.Size = UDim2.new(0, Display1.TextBounds.X, 0, 18)
Display2.Size = UDim2.new(0, Display2.TextBounds.X, 0, 18)

Capture.Text = Display1.Text..Display2.Text..Display3.Text

Position = (400 - Capture.TextBounds.X) / 2
Display1.Position = UDim2.new(0, Position, 0.5, -10)
Position = Position + Display1.TextBounds.X
Display2.Position = UDim2.new(0, Position, 0.5, -10)
Position = Position + Display2.TextBounds.X
Display3.Position = UDim2.new(0, Position, 0.5, -10)
Note.Parent = _G.HUD

end

Always prints 0, even when adding a wait. Why is that?
Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
24 May 2014 10:13 PM
Oops way to much, should only be this:

function game.Workspace.FriendHandler.FriendRequestStatus.OnClientInvoke(Receiver, Accept)

local Note = FriendAcceptNote:Clone()
local Capture = Note:WaitForChild("Capture")
local Display1 = Note:WaitForChild("Display1")
local Display2 =Note:WaitForChild("Display2")
local Display3 = Note:WaitForChild("Display3")

Display1.Text = Receiver.." has "

if Accept then
FriendAcceptNote.Header.Text = "Friend Request Accepted"
Display2.Text = "accepted "
Display2.TextColor3 = Color3.new(0, 153/255, 0)
else
FriendAcceptNote.Header.Text = "Friend Request Declined"
Display2.Text = "declined "
Display2.TextColor3 = Color3.new(223/255, 0, 0)
end

--[[THESE LINES]]
print(Display1.TextBounds.X)
Display1.Size = UDim2.new(0, Display1.TextBounds.X, 0, 18)
Display2.Size = UDim2.new(0, Display2.TextBounds.X, 0, 18)

Capture.Text = Display1.Text..Display2.Text..Display3.Text

Position = (400 - Capture.TextBounds.X) / 2
Display1.Position = UDim2.new(0, Position, 0.5, -10)
Position = Position + Display1.TextBounds.X
Display2.Position = UDim2.new(0, Position, 0.5, -10)
Position = Position + Display2.TextBounds.X
Display3.Position = UDim2.new(0, Position, 0.5, -10)
Note.Parent = _G.HUD

end
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