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

Quick Help on a Chatted Random Event?

Asked by 10 years ago

I am a fairly good scripter but stumbling apon this script that does not seem do execute/work.

ran = math.random(1,100)
game.Players.DhatBoiiPapi:Chatted(function(msg)
    local hint=Instance.new("Hint")
if msg=="/Random/Numbers" then
    hint.Parent=game.Workspace
    hint.Text="Random Number chosen is :"..ran.." !"
    wait(5)
    hint.Parent=nil

end 
end)

Help would be acknowledged

2 answers

Log in to vote
0
Answered by
ultrabug 306 Moderation Voter
10 years ago

The only thing I notice is that the 'random number' will be the same every time since you put it at the beggining of the script, if you put it after line 2 then you would get a new number every time. Also I would put instead of making the hint's parent nill I would do: hint:Destroy().

0
Okay, I will just do hint:Clone(). Thank you, I will see if this helped. DhatBoiiPapi 10 — 10y
0
I don't think that will make it any different, but tell me if it does work like that. :) ultrabug 306 — 10y
0
If it doesn't work, move line 1 to line 3 moving the current line 3 and everything under it down one line. ultrabug 306 — 10y
0
I tried that. It still doesn't work. I think its a problem with the Chatted Event. DhatBoiiPapi 10 — 10y
0
bump.? DhatBoiiPapi 10 — 10y
Ad
Log in to vote
-1
Answered by
Nickoakz 231 Moderation Voter
10 years ago

Repaired Version

ran = math.random(1,100)
game.Players["DhatBoiiPapi"]:Chatted(function(msg)
    if msg:lower()=="randomnumbers" then
        local hint=Instance.new("Hint")
        ran = math.random(1,100)
        hint.Parent=Workspace
        hint.Text="Random Number chosen is :"..ran.." !"
        wait(5)
        hint.Parent=nil
    end 
end)
0
Once agian. Got downvoted for a working version. Nickoakz 231 — 10y
0
I am trying yours. Doesn't seem to work either. DhatBoiiPapi 10 — 10y

Answer this question