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
|
  |
| 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 |
|