Kxghtism
(Kxghtism)
July 17, 2020, 3:26pm
#1
Hi, I’m FunnyDude453. I’m currently working on Doge Miner Classic and I need some help on my wow messages pop up when you click the rock to mine dogecoins.
It goes off a remove event because my actual clicker (where it gives coins) has a debounce and I dont want to make that longer.
It’s either the table or the actual script its self that makes it not work.
Example of the code I wrote below. Please read below the code block.
local wowmessages = {
["regular"] = "wow",
["dogecoin1"] = "such dogecoin",
["dogecoin2"] = "rich doge",
["moon1"] = "doge2moon",
["dogecoin3"] = "so manz dogecoins",
["happy1"] = "happy doge",
["mine1"] = "11/10 mine",
["happy2"] = "very yay",
["amaze1"] = "amaze"
}
script.Parent.NoticeCreate.OnServerEvent:Connect(function()
local wowmessage = script.Parent.Parent.Parent.Lolmessages.Example
wowmessage:Clone().Parent = script.Parent.Parent.Parent.Lolmessages
wowmessage.Text = wowmessage
wowmessage.TextColor3 = math.random(math.random(),math.random(),math.random())
wowmessage.Name = "Wowmessagelol"
wowmessage.Visible = true
local r = Random.new()
wowmessage.Position = UDim2.new(r:NextNumber(0,1),0,r:NextNumber(0,1),0)
wait(0.5)
wowmessage.TextTransparency = 0.25
wait(0.03)
wowmessage.TextTransparency = 0.52
wait(0.06)
wowmessage.TextTransparency = 0.78
wait(0.12)
wowmessage.TextTransparency = 1
wait(0.1)
wowmessage:Destroy()
end)
Alright. You can edit this script if you like and reply below!
I’d be grateful if you did get it right!
You declared two variables with the same name, overwriting the table named “wowmessage” with the location of the Text.
1 Like
Kxghtism
(Kxghtism)
July 17, 2020, 3:56pm
#3
The difference between the two variables is with the
s
So that defeats the purpose of the variable name overrides.
Thanks for replying btw.
Oh well then your issue is even more obvious.
wowmessage.Text = wowmessage
You’re declaring it’s text as it’s self, instead of making a proper table randomizer.
Also, for a nice hint, do not use named indexes when doing this system. It makes it way more difficult.
local Table = {"Item1", "Item2", "Item3"}
local RandomSelection = Table[math.random(1, #Table)]
Kxghtism
(Kxghtism)
July 17, 2020, 4:02pm
#5
Alright, I’ll go try this out.
Sorry for the misfaps
Kxghtism
(Kxghtism)
July 17, 2020, 4:06pm
#6
It does not work unfortunately.
Is it either
wowmessage.Text = RandomSelection
or…
wowmessage.Text = wowmessages
I’ve never used a table before so if this works. It’s the solution!
I ended up seeing multiple issues with your script.
It’s a RemoteEvent with no security, anyone can fire it (on other players too) whenever they want.
You’re not tweening TextTransparency instead slowly changing it.
However, I did fix your script.
local WowMessages, R, TweenService = {"wow", "such dogecoin", "rich doge", "doge2moon", "so manz dogecoins", "happy doge", "11/10 mine", "very yay", "amaze"}, Random.new(), game:GetService("TweenService")
local Debounce = false
script.Parent.NoticeCreate.OnServerEvent:Connect(function()
if Debounce then return end
Debounce = true
local WowMessage = script.Parent.Parent.Parent.Lolmessages.Example:Clone()
WowMessage.Parent, WowMessage.Text, WowMessage.TextColor3, WowMessage.Name, WowMessage.Visible = script.Parent.Parent.Parent.Lolmessages, WowMessages[math.random(1, #WowMessages)], Color3.new(R:NextNumber(), R:NextNumber(), R:NextNumber()), "Wowmessagelol", true
WowMessage.Position = UDim2.new(R:NextNumber(), 0, R:NextNumber(), 0)
local Tween = TweenService:Create(WowMessage, TweenInfo.new(.6, Enum.EasingStyle.Exponential), {TextTransparency = 1})
Tween:Play()
Tween.Completed:Wait()
Debounce = false
end)
1 Like
Kxghtism
(Kxghtism)
July 17, 2020, 4:29pm
#8
Thank you. It did work!
Glad you came!
But I want the text to be a random colour. Not to be white all the time.
Can you edit the bit where it changes the colour to be a randomized?