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
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Player Commands don't work.

Previous Thread :: Next Thread 
VexTrexYT is online. VexTrexYT
Joined: 20 Dec 2016
Total Posts: 63
23 Nov 2017 05:55 PM
I want to make it so your username must be player1 or player2 for the command to work. It perfectly works with one player string but not with two.

function onChatted(msg, recipient, speaker)
source = string.lower(speaker.Name)

local Frame = speaker.PlayerGui.Help.Main --Main Position: {-0.3, 1},{0.1, 1}


--:cmds
if msg == ":guide" and speaker.Name == "player1" or "player2" then
Frame.Visible = true
Frame:TweenPosition(UDim2.new(0.05, 1,0.1, 1), 'Out', 'Bounce', 1)


end
end

function onPlayerEntered(newPlayer)
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
end

game.Players.ChildAdded:connect(onPlayerEntered)



Report Abuse
Laedere is online. Laedere
Joined: 17 Jun 2013
Total Posts: 23601
23 Nov 2017 05:56 PM
if msg == ":guide" and speaker.Name == "player1" or speaker.Name == "player2" then

also i suggest you learn about dictionaries before making admin commands


Report Abuse
VexTrexYT is online. VexTrexYT
Joined: 20 Dec 2016
Total Posts: 63
23 Nov 2017 06:14 PM
Thanks!


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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