detect = workspace.Lottery.Man.Head detect.ClickDetector.MouseClick:Connect(function(plr) if math.random(1, 100) == math.random(1, 100) then game:GetService("Chat"):Chat(detect, "You have won the lottery! Congratulations", "Red") elseif plr.Name == "HappyTimIsHim" then game:GetService("Chat"):Chat(detect, "You have won the lottery! Congratulations", "Red") else game:GetService("Chat"):Chat(detect, "You have lost the lottery. Better luck next time!", "Red") end end)
I have made a lottery script for a man. But when I click the head it doesn't do anything. Also if nothing works let me tell u something. I made a hitbox called head and made the normal head named "fakehead" cuz i was too lazy to changed anything.
First script is in StarterGui. Second script is in the clickdetector. The Remote Event is in Replicated storage.
detect = workspace.Lottery.Man.Head detect.ClickDetector.MouseClick:Connect(function(plr) if math.random(1, 100) == math.random(1, 100) then game:GetService("Chat"):Chat(detect, "You have won the lottery! Congratulations", "Red") elseif plr.Name == "HappyTimIsHim" then game:GetService("Chat"):Chat(detect, "You have won the lottery! Congratulations", "Red") else game:GetService("Chat"):Chat(detect, "You have lost the lottery. Better luck next time!", "Red") end end)