Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)


3 comments

0

Local Script or Server Script?

0

Local

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.

1 answer

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

3 comments

0

I don't know how to use RemoteEvent or Remote Function? Is there a way I can learn??Or can you show me?

This discussion is preserved as it was. New answers, comments, and votes are closed.