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

what is wrong with this? it seems as if there is nothing wrong

Asked by 4 years ago

local Enabled = Active local player = game.Players.LocalPlayer

local NykoID = 123585026 local SethID = 55137798

if script.Parent.Parent.Parent.Parent.UserId == NykoID or SethID then script.Parent.Visible = true script.Parent.Enabled = true else script.Parent.Visible = false script.Parent.Enabled = false script.Parent.Parent:Destroy() end

if function leftClick() then script.Parent.Console.Visible = true else script.Parent.Console.Visible = true end

script.Parent.MouseButton1Click:Connect(leftClick)

something is wrong and i have no idea what it is, can someone help?

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

One thing I see that is wrong is that when using or, you'll need a full condition on the other side. In this particular situation you put if script.Parent.Parent.Parent.Parent.UserId == NykoID or SethID and on the other side of the or SethID is not a full condition. To fix this replace if script.Parent.Parent.Parent.Parent.UserId == NykoID or SethID to

local Enabled = Active 
local player = game.Players.LocalPlayer

local NykoID = 123585026 
local SethID = 55137798

if script.Parent.Parent.Parent.Parent.UserId == NykoID or script.Parent.Parent.Parent.Parent.UserId == SethID then 
    script.Parent.Visible = true
    script.Parent.Enabled = true 
else 
    script.Parent.Visible = false 
    script.Parent.Enabled = false 
    script.Parent.Parent:Destroy() 
end

function leftClick()
    script.Parent.Console.Visible = true 
end

script.Parent.MouseButton1Click:Connect(leftClick)

Another problem was that when you connected the function, what happens is roblox tries to run the function but can't because you did something weird there. I replaced the if statement to the function name you desired so when someone left clicks the function runs.

I hope this helped. (edit was to make the code look better)

Ad

Answer this question