So I recently put in a simple script where a clickdetector makes a GUI visible. But it does not work in game/online. this is the script: the script is inside the GUI, its a localscript not a server one
plr = game.Players.LocalPlayer
text = plr.PlayerGui.quirklabel.TextLabel
click = game.Workspace.Doctor.Head.ClickDetector
click.MouseClick:connect(function()
if plr.check.Value == 1 then
plr.check.Value = plr.check.Value -1
text.Visible = true
wait(2)
text.Text = "Im here to show you your quirk results!"
wait(2)
text.Text = "And your quirk is..."
wait(2)
local quirk = math.random(1,20)
if quirk == 1 then
plr.Quirk.Value = "Super Regeneration"
text.Text = "Super Regeneration!"
end
if quirk == 2 then
plr.Quirk.Value = "Super Regeneration"
text.Text = "Super Regeneration!"
end
if quirk == 3 then
plr.Quirk.Value = "Super Regeneration"
text.Text = "Super Regeneration!"
end
if quirk == 4 then
plr.Quirk.Value = "Super Regeneration"
text.Text = "Super Regeneration!"
end
if quirk == 5 then
plr.Quirk.Value = "Super Regeneration"
text.Text = "Super Regeneration!"
end
if quirk == 6 then
plr.Quirk.Value = "Transparency"
text.Text = "Transparency!"
end
if quirk == 7 then
plr.Quirk.Value = "Transparency"
text.Text = "Transparency!"
end
if quirk == 8 then
plr.Quirk.Value = "Transparency"
text.Text = "Transparency!"
end
if quirk == 9 then
plr.Quirk.Value = "Transparency"
text.Text = "Transparency!"
end
if quirk == 10 then
plr.Quirk.Value = "Transparency"
text.Text = "Transparency!"
end
if quirk == 11 then
plr.Quirk.Value = "Half Hot Half Cold"
text.Text = "Half Hot Half Cold!"
end
if quirk == 12 then
plr.Quirk.Value = "Half Hot Half Cold"
text.Text = "Half Hot Half Cold!"
end
if quirk == 13 then
plr.Quirk.Value = "Half Hot Half Cold"
text.Text = "Half Hot Half Cold!"
end
if quirk == 14 then
plr.Quirk.Value = "Explosion"
text.Text = "Explosion!"
end
if quirk == 15 then
plr.Quirk.Value = "Explosion"
text.Text = "Explosion!"
end
if quirk == 16 then
plr.Quirk.Value = "Explosion"
text.Text = "Explosion!"
end
if quirk == 17 then
plr.Quirk.Value = "Electrification"
text.Text = "Electrification!"
end
if quirk == 18 then
plr.Quirk.Value = "Electrification"
text.Text = "Electrification!"
end
if quirk == 19 then
plr.Quirk.Value = "Electrification"
text.Text = "Electrification!"
end
if quirk == 20 then
plr.Quirk.Value = "One For All"
text.Text = "One For All!"
end
wait(0.8)
plr.Character.Humanoid.Health = 0
text.Visible = false
end
end)

11 comments
is it a local script or server
are you using FE?
It's a localscript, and Im not using FE
Can you check if the event is being ran by adding in some prints.
Just did, and its not being ran
I used to have problems with click detectors working in studio but not in game as well. Its pretty frustrating!
I think this would fix it: Instead of using connect , use Connect becuase connect is depracated.
what?? I thought :Connect was deprecated!
I think click detectors can only be activated with server scripts
It did not work, I tried server scripts, local scripts, and :Connect
try using a text button instead of a click detector if you're using a Gui