hmm maybe you can add something that tells you your username when you display hints
example: “username the chest with the secret item is over there, go get it NOW!”
You can already do that be default. Example:
Hint:setLabel(string.format("%s the chest with the secret item is over there, go get it NOW!", game:GetService("Players").LocalPlayer.Name))
If I were playing the game, %s
would display as my username, of course you can always change it to DisplayName
Is there a way to have a hint controlled by a script? So you can control when it fades away.
What do you mean, do you mean like instead of relying on setVisibleTime
as the amount of time your hint takes to appear and disappear, have a function that allows you to cancel the hint entirely?
Yes, so you can cancel the hint when they have done the action implied by the hint.
Like:
- Turn on the PC.
local Hint = HS.new("Center", false)
Hint:setLabel("Turn on the PC.")
Hint:activateHint(true)
- They have turned it on.
Prompt.Activated:Wait()
Hint:activateHint(false)
Ok so you want me to add this?:
Hint:cancelHint()
That would work if there was an infinitely shown card (not sure if there is.).
Other than that, this is a great module. Thanks!
What do you mean by this? Will the function above achieve what you need it to?
(I will add your feature requests in 1.5)
I would like the ability to show a card and stop it when an objective has been achieved.
If the card removes itself before the objective is achieved via the setVisibleTime
then the function will not meet my needs. That’s what I meant by infinitely shown card.
I can change the setVisibleTime
function to fit your needs, and make the time argument optional.
Example:
Hint:setVisibleTime(isInfinite : boolean, time : number)
I would say to use math.huge
in the time argument instead of a number, but I already tested this and it did not work.
Update 1.5!
Features:
You can now cancel hints regardless of time left on screen.
You can now display hints infinitely.
Removal of all style methods, you can now use themes. Themes were created so people could easily use other peoples hint themes. Use Hint:setTheme(themeName)
to set themes on hints. Read more in the docs
Whats coming v2?
Lots of new things. The complete removal of activation methods, these will be replaced with broadcast methods. These are a bit more straight-forward and contain lots of features.
You will be able to change the type of animation the hint plays, fade
, linear
, and none
.
Events that come with the broadcast functions, Hint.Broadcasted
, Hint.BroadcastCancelled
, Hint.BroadcastRecieved
.
And lots more!
This definitely is a simple and beginner friend module with a lot of features for a simple concept. It’s also better than the simple chat hint system you see in games today.
Update 2.0!
Features:
Deprecated Activation methods and replaced them with broadcast methods.
Somewhat rewritten the module.
You can now set tween types, fade or none.
You can now get tween types and xAlignments
Docs about new features coming soon!
You should update the code sample. It still uses the old .HintAdded
API which is now .HintAdding
. Also the parameter to the event callback has the same name as the HS object. Here is an updated sample:
local HS = require(game:GetService("ReplicatedStorage"):FindFirstChild("HintService"))
local NewHint = HS.new("Center") -- Creates a blank, and new hint
HS.HintAdding:Connect(function(label) -- Connect this to a function to detect when a hint is added
print(string.format("The new hint that was added says '%s'", NewHint:getHintLabel()))
end)
NewHint:setLabel("test") -- Sets the text of NewHint
NewHint:setTweenLength(5, 5) -- Sets how long the animations will last
NewHint:setTweenStyle(Enum.EasingStyle.Linear, Enum.EasingStyle.Linear) -- Sets the animation styles
NewHint:setTweenDirection(Enum.EasingDirection.In, Enum.EasingDirection.Out) -- Sets the animation directions
NewHint:broadcastHintToClient(false)
could you make it a startergui instead of whatever it is? its really hard to figure out whats going on here
What do you mean? If you are trying to find it in-game it’s in Players > username > PlayerGui
I mean making it easier to use, like how do i even use it?
It is easy to use. Read the documentation.
Pretty clean, love the design!
May I reccomend you add notifications that display on the left/right of the screen, (that can be configured in a config script etc.)
E.G a notification pops out from the side nicely then fades away, they can also stack like you said!
All in all, lovely design - this would be great if many games used this as it would become a more universal design that all players begin to get used to using and understand what the hints are, a bit like how ROBLOX proximity prompts are!
Do you mean the option to be able to hide hints from the client and a for example have a topbar button that displays notifications?