okokTextUI
exports['okokTextUI']:Open('[Key] Message', 'color', 'position')
exports['okokTextUI']:Close()
Positions:
- right;
- left.
Colors:
- lightblue / darkblue;
- lightgreen / darkgreen;
- lightred / darkred;
- lightgrey / darkgrey.
Before:
while true do
-- your code
if playerDistance <= distance then
-- your code when you are inside the range
else
-- your code when you are outside the range
end
end
After:
local shown = false
local inDistance = false
while true do
inDistance = false
-- your code
if playerDistance <= distance then
inDistance = true
-- your code when you are inside the range
else
-- your code when you are outside the range
end
if not shown and inDistance then
exports['okokTextUI']:Open('[E] Hello', 'lightgreen', 'right')
shown = true
elseif shown and not inDistance then
exports['okokTextUI']:Close()
shown = false
end
end
Last modified 8mo ago