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

*EXPERTS ONLY* Working on floating cubes that execute commands, no errors? [SOLVED]

The problem is that the little GUI comes up, you type in the code, then nothing happens. And I mean NOTHING, not even an error comes up. Here is the code for a script called PatOrbs Core:

game.Players.PlayerAdded:connect(function(Player)

local RS = game:GetService("ReplicatedStorage")
game:WaitForChild(RS)
	
Player:WaitForChild("PlayerGui")

local PlayerGui = Player.PlayerGui

local PO = script.PatOrbs
PO.Parent = RS
PO.Disabled = false

local c = script.Login:Clone()
c.Parent = PlayerGui

end)

PatOrbs Core contains a script PatOrbs and a GUI Login

Here's the code for PatOrbs, It's long so here's a pastebin: http://pastebin.com/qbQAeFyt

Sorry, I know that was a lot. PatOrbs contains a NumberValue called Login

The ScreenGUI called Login contains a Frame called PassBox which contains a LocalScript, a TextButton called Exit with the text "Exit", a TextButton called Login with the text "Login", a TextBox called PasswordBox, and a TextLabel with the text "PatControl"

Here is the code for the LocalScript in PassBox:

script.Parent:TweenPosition(UDim2.new(0.5, -227, 0.5, -60))

RS = game:GetService("ReplicatedStorage")

script.Parent.Exit.MouseButton1Click:connect(function()
	script.Parent:TweenPosition(UDim2.new(0.5, -227, 2, 0))
	wait(1)
	script.Parent.Parent:Destroy()
end)

script.Parent.Login.MouseButton1Click:connect(function()
	local MT = RS:FindFirstChild("PatOrbs")
	local LoginVal = MT:FindFirstChild("Login")
	LoginVal.Value = script.Parent.PasswordBox.Text
	script.Parent:TweenPosition(UDim2.new(0.5, -227, 2, 0))
	wait(1)
	script.Parent.Parent:Destroy()
end)

That's basically it, please tell me what's wrong with this script and how I could improve it.

8 comments

0

This looks pretty decent, however, you would need to pay me to comb through this. A picture of the explorer would probably help too.

0

If nothing happens, try putting some print values in. It's possible that one of your :Wait() methods never resolved

0

There are a number of things I would change about your code, however. First of all, use local variables sometimes. Use the Clone() method if you are generating multiple objects with mostly the same properties repeatedly. Try to use method syntax when declaring and using methods.

0

You index the same tables over and over, namely the Core table. Again, use local functions for things that are used internally. You can still put local functions into the table for external use later.

0

It's possible the script fails at script.Login.Changed:wait()

0

@Narrev Do not ask for compensations when answering peoples' questions.

0

Yeah I'm not gonna pay you, I'm not that desperate, but thanks for the comments, I'll try some things.

0

@Link150 I didn't ask for compensation. It's an expression. Combing through it is a lot of work, and I wouldn't be able to do it on my time. I made a statement, not a request.

1 answer

Alright, I fixed it myself no need to answer this anymore.

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