What do you want to achieve?
I want the TextLabel to only appear once in the logging system.
What is the issue?
The textLabel is duplicating which is weird.
For example, this is what I am expecting:
[user] is on a streak of [number]!
What I’m getting:
[user] is on a streak of [number]!
[user] is on a streak of [number]!
[user] is on a streak of [number]!
[user] is on a streak of [number]!
What solutions have you tried so far?
I have not tried any solutions so far.
I theorise that the RemoteEvent might be firing multiple times, causing this behaviour to occur. I could be wrong so yea…
this is the code that i wrote:
numOfPushes.Changed:Connect(function()
local pushVal = tostring(numOfPushes.Value)
if streakNumbers[pushVal] then
Remotes.onKillStreak:FireAllClients(
otherPlayer.DisplayName, numOfPushes.Value
)
end
end)
-- local script
Remotes.onKillStreak.OnClientEvent:Connect(function(plrName, val)
local Yeet = Death.Yeet
local clone = Death.Killed:Clone()
clone.Parent = Yeet
clone.TextColor3 = Color3.fromRGB(254, 240, 0)
clone.Text = string.format("<b>%s</b> is on a pushing streak of <b>%d+</b>! " .. epikWords[math.random(1, #epikWords)], plrName, val)
SoundService["bowl"]:Play()
task.wait(6)
clone.Text = ""
clone:Destroy()
end)
Any help will be greatly appreciated, thanks.
1 Like
Just to clarify, does it duplicate more than once after the first time, or does it duplicate more than once the first time?
1 Like
jaipack17
(jaipack17)
August 6, 2021, 9:40am
3
This code, can be changed to the following:
numOfPushes:GetPropertyChangedSignal("Value"):Connect(function()
local pushVal = tostring(numOfPushes.Value)
if streakNumbers[pushVal] then
Remotes.onKillStreak:FireAllClients(
otherPlayer.DisplayName, numOfPushes.Value
)
end
end)
1 Like
yea, it duplicates more than once the first time i see the streak message pop up.
aight, will take note of this thank you.
1 Like
xJon_as
(Jonas)
August 6, 2021, 10:00am
6
Did that resolve your issue? Just so I know of I still need to look into it.
2 Likes
Appreciate the help so far, but unfortunately did not.
The first streak is detected once someone reaches 5.
I put a print statement for debugging and found it had printed 4 times, meaning the streak message showed up 4 times.
1 Like
oh nah, i just wrote “i have been summoned!” in the code for debugging so it’s not a virus or anything just to let you know.
oh mk, will check it out tho thanks.
s_eaborn
(s_eaborn)
August 6, 2021, 10:42am
13
Stop trying to advertise your antivirus plugin.
3 Likes
s_eaborn
(s_eaborn)
August 6, 2021, 10:50am
15
By continuously posting about it? On a forum?
2 Likes
s_eaborn
(s_eaborn)
August 6, 2021, 11:23am
18
vergelrady:
it’s a classic if name == list of bad names then warn use about it
Oh wow, that’s very technical. Lots of work looks like it was put in it.
s_eaborn
(s_eaborn)
August 6, 2021, 12:29pm
24
Can you please provide a link to your website?
Also, post updates in your own thread.
xJon_as
(Jonas)
August 7, 2021, 1:45pm
26
Where in your code is the GUI label created?
nvm, fixed it. thanks for the help.