So I am making admin commands and they work fine in roblox studio but when I try to use them in like Script Builder or My game they don't work...
Script:
local Admins = {["silverminer226"] = true, ["Player"] = true, ["RLuaScripting"] = true} function onChatted(message, player) if message == "create/Part" and Admins[player.Name] then a = Instance.new("Part", workspace) end end game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(message) onChatted(message, player) end) end)
I asked some people and they said it needed to be client sided and I have no clue how to do that xD
Personally, I don't see why it needs to be client-sided. It is very limiting.
Also, I will make the script better/more efficient:
local admins = { [¨PlayerName¨] == true -- you dont need to do Player or your username, because this script does it for you } game.Players.PlayerAdded:connect(function(p) if admins[p.Name] or p.UserId == game.OwnerId then -- your userId is the same when youre Player p.Chatted:connect(function(msg) if msg == ¨create/part¨ then local a = Instance.new(¨Part¨) a.Parent = game.Workspace -- simply defining a local does not create a part, i think end end) end end)
This should work.
I don't think so guys, About those Comments, As far as i know, I made this:
http://www.roblox.com/Nathans-Simple-Admin-Commands-Script-item?id=322960285
"Local Won't really make it work, Since from what i know FilteringEnabled, it would only make it for that client, and not globally on the server."
First.
Does your game have FilteringEnabled
Set to True or False?
if False, I may not be able to help you, If true
Try the script i have there,
Making the part code was correct.
Just, Let's say, Maybe you want it to be positioned where the people stands at? Well, There goes the problem, You have to get a Vector3 of the Torso
that the player Executed
, and take its Location
, and position the part to it.
You did it using only Instance.new
Which automatically positions them to the Vector 3 of 0,0,0
TL;DR The Code Sounds Right, But with Direct Instance.New, it's auto-positioned to 0,0,0
Excuse my English :P