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 » Scripting Helpers
Home Search
 

Re: Admin Spawn

Previous Thread :: Next Thread 
ThatWhipperSnapper is not online. ThatWhipperSnapper
Joined: 11 May 2012
Total Posts: 1566
10 Oct 2012 11:33 AM
Once again,I've been working since 5:30AM and I need someone to check something for me. I'm making a script for a Admin only spawn,but when i spawn,It puts me on the admin team,but spawns me in the normal spawn(Yes,The Script is inside the correct spawn) I changed team colors,etc,etc. Will someone help me out with this? I'm a little hazy when it comes to scripting with only 5 hours of sleep.
Report Abuse
Daelus is not online. Daelus
Joined: 06 Sep 2012
Total Posts: 144
10 Oct 2012 11:37 AM
Code and output (if possible)?
Report Abuse
ThatWhipperSnapper is not online. ThatWhipperSnapper
Joined: 11 May 2012
Total Posts: 1566
10 Oct 2012 11:40 AM
print ("VIP Spawn Script Loaded")

-- list of people who will spawn here
permission = { "ThatWhipperSnapper" } --change NameHere to the usernames of the VIPs


texture = "" --see the wiki on how to change shirts.

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

function onPlayerEntered(newPlayer)
print("Person Spawned")
local human = newPlayer:findFirstChild("Humanoid")
if (human ~= nil ) then
if human.Parent.Torso.roblox.Texture == texture then
print("Humanoid Is VIP")
human.Parent.Torso.TeamColor=script.Parent.TeamColor
elseif (checkOkToLetIn(human.Parent.Name)) then
human.Parent.Torso.TeamColor=script.Parent.TeamColor
end
end
end

game.Players.PlayerAdded:connect(onPlayerEntered)
Report Abuse
Daelus is not online. Daelus
Joined: 06 Sep 2012
Total Posts: 144
10 Oct 2012 12:10 PM
    -- Credit to Daelus for making this script.
    vip = {"ThatWhipperSnapper", "Daelus"}
    shirt = ""
    
    function checkUser(name)
        for i = 1, #vip do
            if name:lower() == permissions[i]:lower() then
                return true
            end
        end
    end
    
    game.Players.PlayerAdded:connect(function(player)
        player.CharacterAdded:connect(function(char)
            if player.Character.ShirtGraphic then
                if player.Character.ShirtGraphic.Graphic == texture then
                    player.TeamColor = script.Parent.TeamColor
                end
           end
        end)
    
        if checkUser(player.Name) then
            player.Teamcolor = script.Parent.TeamColor
        end
    end)
Report Abuse
Daelus is not online. Daelus
Joined: 06 Sep 2012
Total Posts: 144
10 Oct 2012 12:14 PM
Whoops. Line 22 - 24, I forgot to add a filter. I also forgot to capitalize "Color" in "TeamColor".

>     if player.TeamColor ~= script.Parent.TeamColor and checkUser(player.Name) then
        player.TeamColot = script.Parent.TeamColor
    end
Report Abuse
Daelus is not online. Daelus
Joined: 06 Sep 2012
Total Posts: 144
10 Oct 2012 12:15 PM
Man, I wish I could just edit posts.

Line 23, I put "Colot" instead of "Color". e.e
Report Abuse
ThatWhipperSnapper is not online. ThatWhipperSnapper
Joined: 11 May 2012
Total Posts: 1566
10 Oct 2012 12:24 PM
Thanks man! Works Perfectly! I have one more if you'd like to help me with it.
Report Abuse
ThatWhipperSnapper is not online. ThatWhipperSnapper
Joined: 11 May 2012
Total Posts: 1566
10 Oct 2012 12:25 PM
I Made a GUI Button that when you push it,It teleports you to a specific point. I've been working on this project since 5 AM and I'm a little hazy right now when it comes to scripting. Can some one Fix this script I made?




function onButtonClicked()
local player = game.Players.LocalPlayer
if player == nil or player.Character == nil then return end
local char = player.Character.Torso
char.CFrame = CFrame.new(Vector3.new(-303.1, 128.5, -40.19))

end
Report Abuse
Daelus is not online. Daelus
Joined: 06 Sep 2012
Total Posts: 144
10 Oct 2012 12:40 PM
    -- I suppose this would work, probably not as efficient as a LocalScript.
    game.Players.PlayerAdded:connect(function(player)
        player.CharacterAdded:connect(function(char)
            local char = char
        end)
    end)

    script.Parent.MouseButton1Click:connect(function()
        if char then
            if char:findFirstChild("Torso") then
                 char.Torso.CFrame = CFrame.new(-303.1, 128.5, -40.19)
            end
        end
    end)
Report Abuse
ThatWhipperSnapper is not online. ThatWhipperSnapper
Joined: 11 May 2012
Total Posts: 1566
10 Oct 2012 12:47 PM
Doesnt work.
Report Abuse
Daelus is not online. Daelus
Joined: 06 Sep 2012
Total Posts: 144
10 Oct 2012 12:49 PM
I was hoping I would go on a streak...
Give me about 10 minutes, maybe.
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