Hey, i am trying to make a number float up and then disappear, but i have it set up so where when i click the button, the text will go to the mouse's position, but i don't know how to make it float up without it tracking the mouse. I have a idea of what i want to happen but i dont know how to put it.
Player = game.Players.LocalPlayer Mouse = Player:GetMouse() local function NumberHappen() local Text = Instance.new("TextLabel") Text.Name = "Text" Text.Parent = script.Parent.Parent Text.Position = UDim2.new(0,Mouse.x,0,Mouse.y) Text.Size = UDim2.new(0,0,0,0) Text.Text = "1+" Text.BackgroundTransparency = 1 Text.TextColor3 = Color3.new(255,255,255) Text.TextSize = 32 wait(1) Text:Destroy() end script.Parent.MouseButton1Click:Connect(function() NumberHappen() end)
Is this what you mean?
Player = game.Players.LocalPlayer Mouse = Player:GetMouse() local function NumberHappen() local x = Mouse.x local y = Mouse.y local Text = Instance.new("TextLabel") Text.Name = "Text" Text.Parent = script.Parent.Parent Text.Position = UDim2.new(0,x,0,y) Text.Size = UDim2.new(0,0,0,0) Text.Text = "1+" Text.BackgroundTransparency = 1 Text.TextColor3 = Color3.new(255,255,255) Text.TextSize = 32 for i = 1, 20 do -- change 20 to your liking Text.Position = Text.Position - UDim2.new(0,0,0,5) -- change 5 to your liking wait() end Text:Destroy() end script.Parent.MouseButton1Click:Connect(function() NumberHappen() end)