Hello, I'd like to do a GUI which is showing the Hertz Value but it doesn't work. In the output windows, I can see :
10:37:00.551 - Players.Player.PlayerGui.HUD.Script:5: attempt to call global 'Hertz' (a number value) 10:37:00.552 - Stack Begin 10:37:00.552 - Script 'Players.Player.PlayerGui.HUD.Script', Line 5 10:37:00.552 - Stack End
Here is my script
1 | HUD = script.Parent |
2 | Hertz = HUD.Hertz.Value |
3 | Hertz_Shower = HUD.HertzDisplayer.Hertz |
4 |
5 | Hertz_Shower.Text = "" ..Hertz " Hertz" |
With variables, you can't just use v = v.Value
because variables cannot hold a value. Instead, you should make Hertz equal to just HUD.Hertz and call the value later on. In addition, you'd also need to concatenate after the value. This code below should do the trick.
1 | HUD = script.Parent |
2 | Hertz = HUD.Hertz |
3 | Hertz_Shower = HUD.HertzDisplayer.Hertz |
4 |
5 | Hertz_Shower.Text = "" ..Hertz.Value.. " Hertz" |
1 | HUD = script.Parent |
2 | Hertz = HUD.Hertz |
3 | Hertz_Shower = HUD.HertzDisplayer.Hertz |
4 | Hertz_Shower.Text = Hertz.Value.. " Hertz" |