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

Why won't it work in the game?but it works in studios?

Asked by 8 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

It works studios but not in the actual game? why won't it work? can anyone help?

--Script and Gui made by motorcrossguy313
--Please don't mess with anything if you want to change code read my instruction below
--Give Credit To motorcrossguy313 and Promote him to Dev!
--This could be good for group pass, try out the group method.For games only for group member no pass.
local Code = script.Parent.Parent.Parent.Password.Code
local player = game.Players.LocalPlayer
local wrongs = 0
function C()
if Code.Text == "2593316" then --This is the code change the numbers to what chu want. - motor
    player.PlayerGui.EntryGui.ENTER.TextButton.TextTransparency = 1
    wait(.1)
    Code.TextTransparency = 1
    wait(.1)
    Code.TextStrokeTransparency = 1
else
    if wrongs == 0 then
    player.PlayerGui.EntryGui.Wrong1.Visible = true
wait(.5)
    player.PlayerGui.EntryGui.Wrong1.Visible = false
        wrongs = wrongs+1
     wait(.1)
    elseif wrongs == 1 then
    player.PlayerGui.EntryGui.Wrong1.Visible = false
    player.PlayerGui.EntryGui.Wrong2.Visible = true
wait(.5)
    player.PlayerGui.EntryGui.Wrong2.Visible = false
    wrongs = wrongs+1
     wait(.1)
    elseif wrongs == 2 then
    wrongs = wrongs+1
    player.PlayerGui.EntryGui.Wrong1.Visible = false
    player.PlayerGui.EntryGui.Wrong2.Visible = false
    player.PlayerGui.EntryGui.Wrong3.Visible = true
wait(.5)
    player.PlayerGui.EntryGui.Wrong3.Visible = false
wait(1)
    player.PlayerGui.EntryGui.FailedBox.Visible = true
wait(1)
    player.PlayerGui.EntryGui.FailedBox.Visible = false
wait(1)
    player:Kick()
        end
    end
end
script.Parent.MouseButton1Click:connect(C)


0
Local Script or Server Script? M39a9am3R 3210 — 8y
0
Local User#9821 0 — 8y
0
Also, I would not try taking credit for other people's work. I've seen your previous questions and they all show lack of effort. M39a9am3R 3210 — 8y

1 answer

Log in to vote
1
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
8 years ago

LocalPlayer can only be accessed from a LocalScript.

For a Script (when in a server), it will be nil.


:Kick() will only work from a normal Script, it will not work from a LocalScript.

You will need to have two scripts working together to accomplish this.

A RemoteEvent or RemoteFunction is the "proper" way to accomplish this communication

0
I don't know how to use RemoteEvent or Remote Function? Is there a way I can learn??Or can you show me? User#9821 0 — 8y
Ad

Answer this question