I'm trying to create a tool that when you click with it in your hand has a 50/50 chance to give you 2 types of effects when I tested to see if this script would work I saw it had no errors but even when clicking it did nothing. Here is my script.
local tool = script.Parent local h = game.Players.LocalPlayer.Character.Humanoid local RandomNumber = math.random(1,2)
tool.Activated:Connect(function() if RandomNumber == 1 then h.MaxHealth = h.MaxHealth + 50 h.Health = h.Health + 50 end if RandomNumber == 2 then game.StarterGui.Blind.Enabled = true if h.Health == 0 then game.StarterGui.Blind.Enabled = false end end end)

1 comment
Make sure the randomnumber is local and defined within the tool.Activated function, otherwise the number will always be the same no matter how many times you use the tool.