generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Trying to learn tables. I just guessed on what to do.

Previous Thread :: Next Thread 
Xyaioh is not online. Xyaioh
Joined: 01 May 2013
Total Posts: 662
11 May 2013 02:35 AM
admins = {"Xyaioh", "Nobody"}


function check(player)
for i,v in pairs("admins") do
if player == #admins then
return true
else
return false
end
end
end
Report Abuse
Xyaioh is not online. Xyaioh
Joined: 01 May 2013
Total Posts: 662
11 May 2013 02:36 AM
LOL. I am such a beginner scripter.

This is just what I guessed what I had to do.

admins = {"Xyaioh", "ff"}


function check(player)
for i,v in pairs("admins") do
if player == #admins then
return true
else
return false
end
end
end


function onButtonClicked()

if check == true then
game.Lighting.Map1:clone().Parent = game.Workspace
else
print("No permission")
end

end

script.Parent.MouseButton1Click:connect(onButtonClicked)
Report Abuse
Voidion is not online. Voidion
Joined: 01 Aug 2011
Total Posts: 2668
11 May 2013 02:40 AM
for i,v in pairs(admins) do
Report Abuse
Xyaioh is not online. Xyaioh
Joined: 01 May 2013
Total Posts: 662
11 May 2013 02:40 AM
Wait so did I do some of it right???? o.o
Report Abuse
Voidion is not online. Voidion
Joined: 01 Aug 2011
Total Posts: 2668
11 May 2013 02:41 AM
Everything but that one line. :)
Report Abuse
Xyaioh is not online. Xyaioh
Joined: 01 May 2013
Total Posts: 662
11 May 2013 02:42 AM
I just patted myself on the back.

I totally just guessed what it would be. Wow.

I'm happy now xD
Report Abuse
Xyaioh is not online. Xyaioh
Joined: 01 May 2013
Total Posts: 662
11 May 2013 02:45 AM
admins = {"Xyaioh", "Player", "Player1"}


function check(player)
for i,v in pairs(admins) do
if player == #admins then
return true
else
return false
end
end
end


function onButtonClicked()

if check() == true then
print("Is an Admin")
else
print("No permission")
end

end

script.Parent.MouseButton1Click:connect(onButtonClicked)

That is the current script for testing, and the output keeps posting

No permission.

Halp?
Report Abuse
Voidion is not online. Voidion
Joined: 01 Aug 2011
Total Posts: 2668
11 May 2013 03:02 AM
Try this:


admins = {"Xyaioh", "Player", "Player1"}


function check(name)
for i = 1,#admins do
if (string.upper(name) == string.upper(admins[i])) then
return true end
end
return false
end


function onButtonClicked(player)
if (check(player.Name)) then
print("Is an Admin")
else
print("No permission")
end

end
script.Parent.MouseButton1Click:connect(onButtonClicked)
Report Abuse
Xyaioh is not online. Xyaioh
Joined: 01 May 2013
Total Posts: 662
11 May 2013 03:06 AM
Thanks!

Even though while you were fixing my terrible noobish mistakes I was trying a new script...



player = script.Parent.Parent.Parent
admins = {"Xyaioh","Player", "Player1"}
isAdmin = false


function showIsAdminMessage(player)

local message = Instance.new("Message")
message.Parent = player.PlayerGui
message.Text = " Permission Granted To ".. player.Name ". You have access to Training Maps."
wait(5)
failmessage:remove()
end

function showIsntAdmin(player)
local failmessage = Instance.new("Message")
failmessage.Parent = player.PlayerGui
failmessage.Text = " Permission Not Granted To ".. player.Name "."
wait(5)
failmessage:remove()
end




for i = 1, #admins do
if player.Name == admins[i] then
isAdmin = true
showIsAdminMessage()
else
showIsntAdmin()
break
end
end

if not isAdmin then
script.Parent:remove()
wait(0.5)


end
Report Abuse
Voidion is not online. Voidion
Joined: 01 Aug 2011
Total Posts: 2668
11 May 2013 03:07 AM
fancy :o
Report Abuse
Xyaioh is not online. Xyaioh
Joined: 01 May 2013
Total Posts: 662
11 May 2013 03:09 AM
>Testing now . . .
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image