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

Chatted Script Help!? [V4]

Asked by 9 years ago
admins = {"iispear","Pep","Pep2","Pep3"}

function isPlayerAdmin (name)
    for i,v in pairs(admins) do
        if name ==  v then
            return true
        end
    end
end

function chatted(msg,rec)
if string.sub(msg,1,5) == "HSoulDrop" then
-----
H   --This is where i want the Progress to being so i have a union
E   --Put in lighting that i want to be cloned and positioned infront
L   --of you i cant do this at all its been bugging me for a day
P   --HELP! ~Thanks-
-----

end
end



function playerAdded(newplayer)
    if isPlayerAdmin (newplayer.Name) then
        newplayer.Chatted:connect(chatted)

    end
end

game.Players.PlayerAdded:connect(playerA­dded)

Another script Layout For The admin I CAN NOT do it i tried everything how would i get a union in lighting cloned and infront of you

If this Counts as spam Am sorry !

3 answers

Log in to vote
0
Answered by 9 years ago

Things like Models and Parts can no longer be stored in lighting; rather, it is much safer to store them in ServerStorage. As the name implies, you should be accessing models and such in ServerStorage using Scripts, not LocalScripts. A sample of using ServerStorage (once again in a Script) would be as follows...

local model = game.ServerStorage.Model:Clone() -- makes a reference to the model "Model" in ServerStorage, clones it, and stores it to the variable "model"
-- visible properties, such as position, rotation, transparency, and such should be set here, before parenting it to the workspace.
model.Parent = workspace -- set the parent of the model to the workspace
-- more manipulation of model

One last thing to note is that ServerStorage does not work with just Models, it also works with Parts, Unions, Folders, and more.

I hope this helps! - Programmix

Ad
Log in to vote
0
Answered by
yumtaste 476 Moderation Voter
9 years ago

Just try the fixed code, I can explain it later.

admins = {"iispear","Pep","Pep2","Pep3"}

function isPlayerAdmin(name)
    for i,v in pairs(admins) do
        if name ==  v then
            return true
        end
    end
end

function chatted(msg,rec)
if msg and string.sub(msg,1,9) == "HSoulDrop" then
-----
H   --This is where i want the Progress to being so i have a union
E   --Put in lighting that i want to be cloned and positioned infront
L   --of you i cant do this at all its been bugging me for a day
P   --HELP! ~Thanks-
-----

end
end



function playerAdded(newplayer)
    if isPlayerAdmin(newplayer.Name) then
        newplayer.Chatted:connect(chatted)

    end
end

game.Players.PlayerAdded:connect(playerA­dded)
Log in to vote
0
Answered by 9 years ago

First, you don't need to use 'if msg' because there is no way there is no message when you chat. Second, if you are going to match messages like that, you might as well just use if msg=='HSouldDrop'because using string.sub with this is pretty useless. Yumtaste's version will work though.

Answer this question