Local Script works in Studio mode, but not in Play mode?
This is a local script that will work when I test in studio mode, but won't when I play from the roblox website.
The whole script is:
01 | lp = game.Players.LocalPlayer |
03 | frame = gui.Welcome.Frame |
11 | [ "XtremeSpy" ] = workspace.ec.Value, |
12 | [ "Frostari" ] = workspace.fs.Value |
15 | function isPlayerAdmin(p) |
16 | for i,v in pairs (admins) do |
19 | elseif p:IsInGroup(groupid) and p:GetRankInGroup(groupid) > 11 then |
25 | function checkStat(static) |
26 | types = { "Kills" ; "Deaths" ; "Points" ; "Demerits" ; "Promotion" } |
27 | local check = static:lower() |
28 | for i,v in pairs (types) do |
30 | print (v:lower():sub( 1 ,check:len())) |
31 | if v:lower():sub( 1 ,check:len()) = = check then |
38 | local p 1 = name:lower() |
39 | for i,v in pairs (game.Players:GetPlayers()) do |
40 | if string.sub(v.Name, 1 , p 1 :len()):lower() = = p 1 then |
46 | submit.MouseButton 1 Down:connect( function () |
47 | if isPlayerAdmin(game.Players.LocalPlayer) = = true then |
48 | if string.len(value.Text) > 0 and string.len(stat.Text) > 0 and string.len(player.Text) > 0 then |
49 | if tonumber (value.Text) ~ = nil and checkStat(stat.Text)~ = "Promotion" and getP(player.Text)~ = nil then |
50 | local vlu = tonumber (value.Text:match( "%d+" )) |
51 | local sts = checkStat(stat.Text) |
52 | local plyr = getP(player.Text) |
53 | plyr.leaderstats [ sts ] .Value = vlu |
54 | elseif tonumber (value.Text) = = nil and checkStat(stat.Text) = = "Promotion" and getP(player.Text)~ = nil then |
55 | if value.Text:lower() = = "yes" then |
58 | local plyr = getP(player.Text) |
59 | plyr.leaderstats [ sts ] .Value = vlu |
60 | elseif value.Text:lower() = = "no" then |
63 | local plyr = getP(player.Text) |
64 | plyr.leaderstats [ sts ] .Value = vlu |
68 | value.Text = "< Value >" |
70 | player.Text = "< Player >" |
74 | reset.MouseButton 1 Down:connect( function () |
75 | for i,v in pairs (game.Players:GetPlayers()) do |
76 | for k,val in pairs (v.leaderstats:GetChildren()) do |
77 | if val:IsA( "IntValue" ) then |
79 | elseif val:IsA( "StringValue" ) and val.Name = = "Promotion" then |
But the only part that doesn't work is the, reset.MouseButton1Down:connect, on