I'm making a quest system and I want the player to receive half of what the quest wants the player to get in money.
local plr = game.Players.LocalPlayer local q = plr:WaitForChild("QuestGrass") local qa = plr:WaitForChild("QuestActive") script.Parent.Changed:Connect(function() script.Parent.TextArea.Text = "Hey there can you get me " .. q.Value .. " Grass and I'll give you $" .. q.Value/2 .. " in return" end)
To round numbers, you simply use the math.floor
or math.ceil
methods.
In a script, if you wanted to lets say round UP the value 0.5 you would use math.ceil. A good way to remember this is ceilings are UP hence math.ceil.
If you wanted to round DOWN a value lets say 2.2 you would use math.floor. You can remember this because floors are DOWN hence math.floor.
Hope this helps :)