Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Does anyone know anything about getting info on a gui element to only show once?

Asked by 8 years ago
Edited 8 years ago

I have been having trouble for the past week, here's how far i got before actually coming here to ask for help.The reason why i am here is because to get help on how to make sure it only displays some info once, and not over and over again.

This LocalScript handles everything to do with the player's GUI. In this case the event bar, which displays information on the player's screen, such as who killed who with what.

001local Main = script.Parent.Parent.PlayerGui.Main
002local BattleUI = script.Parent.Parent.PlayerGui.BattleUI
003local LoTrig = game.ServerStorage.LoTrig
004 
005 
006----|----- EventBar -----|----
007local EventBar = BattleUI.EventBar
008local View = BattleUI.EventBar.View
009local Bar = BattleUI.EventBar.View
010local Bar1 = View.Bar1
011local Bar2 = View.Bar2
012local Bar3 = View.Bar3
013local Bar4 = View.Bar4
014local Bar5 = View.Bar5
015local On1 = Bar1.On
View all 160 lines...

This LocalScript is used to fire an event that triggers the function, EventFrameDisplay. This method is used on my custom gun; to fire the LoTrig Event, which in turn, triggers the function that displays the information.

01hitHumanoid = findFirstClass(H.Parent, "Humanoid")
02 
03            if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) then
04                local Tag = Instance.new("ObjectValue")
05                Tag.Value = Player
06                Tag.Name = "creator"
07                Tag.Parent = hitHumanoid
08                DS:AddItem(Tag, 0.3)
09                local chosenDamage = 0
10                if H.Name == "Head" then
11                    chosenDamage = baseDamage  * RAND(hVal, hVal + 0.1, 0.01)
12                elseif H.Name == "Torso" then
13                    chosenDamage = baseDamage  * RAND(cVal, cVal + 0.1, 0.01)
14                else
15                    chosenDamage = baseDamage  * RAND(lVal, lVal + 0.1, 0.01)
View all 23 lines...

I have gotten it to work on the previous attempts, but it kept on sending information over and over like this if ran. The event was fired through my own custom gun, but i'll just leave an trigger within the script

This was put into a local script that was placed in game.StarterPlayer.StarterPlayerScripts.

Any answer related to this will be greatly aprecciated.

And if needed, you may ask for the gun script. Here's an piece.

EDIT: Forgot to include the link to the ui.

https://www.roblox.com/games/723299178/Get-ui-element-through-here

0
Please describe your problem. And If you dump massive scripts, explain them. cabbler 1942 — 8y

Answer this question