|
|
Line 11: |
Line 11: |
| =Codes= | | =Codes= |
|
| |
|
| == Name Changing Tool ==
| |
|
| |
| *'''Name''' Name Changing Tool
| |
| *'''Type''' A tool used to change a player's name.
| |
| *'''Author''' [[User:Shanethe13|Shanethe13]]
| |
| *'''Description''' This tool will change a user's name to a value defined in the script after being fired at a player. (Read Comments)
| |
| *'''Warning''' If a player whose name has been changed touches any scripts such as an VIP door, or a cash based shop, the script in question may break.
| |
| *'''Code'''
| |
| <pre>
| |
| bin=script.Parent
| |
|
| |
| newName = "UnworthyofaName" --Change "UnworthyofaName" to a name of your choice.
| |
|
| |
| function onButton1Down(mouse)
| |
|
| |
| mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
| |
|
| |
| local hit = mouse.Target
| |
| if (hit == nil) then return end
| |
| humanoid = hit.Parent:findFirstChild("Humanoid")
| |
| if(humanoid == nil) then return end
| |
| game.Players:findFirstChild(hit.Parent.Name).Name = newName
| |
| hit.Parent.name = newName
| |
| mouse.Icon = "rbxasset://textures\\GunCursor.png"
| |
| end
| |
|
| |
|
| |
| </pre>
| |
|
| |
| == DHTML Window ==
| |
|
| |
| *'''Name''' DHTML Window
| |
| *'''Type''' DHTML Manipulation
| |
| *'''Author''' [[User:Aeacus|Aeacus]]
| |
| *'''Description''' A script which causes a window coded in HTML to pop up when a user joins an online server.
| |
|
| |
| *'''Note''' This script comes in two parts, the window, and the script which causes the window to popup. Name the first of the two "DHTML" and the second any name of your choosing. As for the DHTML window, the only editing required, is the changing of the text shown.
| |
|
| |
| *'''The Window - Make this a Local Script, and name it "DHTML'''
| |
| <pre>
| |
|
| |
| local w = game:service("HtmlService"):NewWindow()
| |
|
| |
|
| |
|
| |
| w.DocumentComplete:connect(function ()
| |
| w:SetBody([==[
| |
|
| |
| <table width="420" height="190" border="0">
| |
| <tr>
| |
| <td width="490" bgcolor="#FFFFFF"><font color="#000000">
| |
| </font><div align="center">
| |
| <p><font color="#000000"><b>Winter Wonderland</b></font></p>
| |
| <p><font color="#000000">Aeacus</font></p>
| |
| <p><font color="#000000">Welcome to Winter Wonderland, both my submission for the winter building contest, and my first map! Although the map is not complete as of now, I hope you enjoy that which I have currently made. For the most part, this map is a simple brickbattle, using various snowballs as weapons!</font></p>
| |
| <br>
| |
| <p><font color="#00FF00">As of now, 'Kills' are referenced as 'Melts' and 'Wipeouts' are known as 'Thaws'</font></p>
| |
| <br>
| |
| <p><font color="#FF0000">As of now, all the weapons work perfectly except the "Spear of FrostBite" If you have this weapon, unequiping it will cause it to break.</font></p>
| |
| </div>
| |
| </td>
| |
| </tr>
| |
| </table>
| |
|
| |
| ]==])
| |
|
| |
| w:Show()
| |
| end)
| |
|
| |
| w:Navigate()
| |
| </pre>
| |
|
| |
| *'''Show Window - Makes the window pop up when somebody joins.'''
| |
| <pre>
| |
|
| |
| function onPlayerEntered(newPlayer)
| |
| while true do
| |
| if newPlayer.Character ~= nil then break end
| |
| wait(2)
| |
| end
| |
| game.Workspace.DHTML:clone().Parent = newPlayer.Character
| |
| end
| |
| game.Players.ChildAdded:connect(onPlayerEntered)</pre>
| |
| <B><U>ROBLOX has stopped the use of DHTML windows online due to (I maybe mistaken) the ability to hack roblox</U></B>
| |
|
| |
| == Beacon Script ==
| |
|
| |
| *'''Name''' Beacon Script
| |
| *'''Type''' A Team Chaging SpawnPoint
| |
| *'''Author''' [[User:lavamaster|lavamaster]]
| |
| *'''Fixed By:'''Dingdong272
| |
| *'''Refixed By:'''kiddietron
| |
| *'''Description''' When you touch the Opponents Spawnpoint it will change into your team's spawn point
| |
| *'''Instructions''' Put this script into a SpawnLocation
| |
| *'''Code'''
| |
| <pre>team = script.Parent
| |
|
| |
| function onTouch(hit)
| |
| local user = game.Players:GetPlayerFromCharacter(hit.Parent)
| |
| if user ~= nil then
| |
| team.TeamColor = user.TeamColor
| |
| team.BrickColor = user.TeamColor
| |
| end
| |
| end
| |
|
| |
| script.Parent.Touched:connect(onTouch)
| |
| </pre>
| |
|
| |
| ==Statue-O-Matic Brick==
| |
|
| |
| *'''Name''' Statue-O-Matic Brick
| |
| *'''Type''' Player-LOLing brick
| |
| *'''Author''' WackoMcGoose
| |
| *'''Description''' When the pedestal is touched, the player is teleported to the top of the pedestal, turned completely gray, and every part anchored, essentially making a statue.
| |
| *'''Instructions''' Make a pedestal of gray bricks. The pedestal can have any variety of bricks in it, but it MUST have a (2, 0.4, 2) gray plate at the top named "PedestalTopBrick" in the same model as the rest of the pedestal bricks, preferrably centered on the pedestal's top. Put this script into each every in the pedestal EXCEPT the PedestalTopBrick.
| |
| *'''Code'''
| |
| <pre>
| |
| function MakeAStatue(hit)
| |
| Player = hit.Parent
| |
| PedestalTop = script.Parent.PedestalTopBrick
| |
| if (Player.Torso ~= nil) then --the obligatory check-if-its-a-Humanoid thing
| |
| Player.Torso.CFrame = PedestalTopBrick.CFrame + CFrame.new(0, 3, 0)
| |
| --turn to stone color
| |
| Player.Torso.BrickColor = BrickColor.new(194) --gray
| |
| Player.Head.BrickColor = BrickColor.new(194)
| |
| Player:findFirstChild("Left Arm").BrickColor = BrickColor.new(194)
| |
| Player:findFirstChild("Right Arm").BrickColor = BrickColor.new(194)
| |
| Player:findFirstChild("Left Leg").BrickColor = BrickColor.new(194)
| |
| Player:findFirstChild("Right Arm").BrickColor = BrickColor.new(194)
| |
| --now freeze the player
| |
| Player.Torso.Anchored = true
| |
| Player.Head.Anchored = true
| |
| Player:findFirstChild("Left Arm").Anchored = true
| |
| Player:findFirstChild("Right Arm").Anchored = true
| |
| Player:findFirstChild("Left Leg").Anchored = true
| |
| Player:findFirstChild("Right Leg").Anchored = true
| |
| --If your place has no suicide/kill tool, uncomment the next two lines so that the player is not a statue forever. Unless you want them to be (insert evil laugh here).
| |
| --[[wait(30)
| |
| Player.Torso:Remove()]]
| |
| end
| |
| end
| |
|
| |
| script.Parent.Touched:connect(MakeAStatue)
| |
| </pre>
| |
|
| |
| == Working Ammo Script ==
| |
|
| |
| *'''Name''' Working Ammo Script
| |
| *'''Type''' Ammo in guns
| |
| *'''Author''' foamythesqurriel
| |
| *'''Description''' A script that is easy to enter into a weapon that gives it ammo.
| |
| *'''Code'''
| |
|
| |
|
| |
| <pre> --[[ Instructions for use....
| |
| 1) put this script in a weapon
| |
| 2) find the "fire" function inside the "shooter" script of the weapon...
| |
| Ex: function fire()
| |
| 3)put the following script right below the first line of the fire function...
| |
|
| |
| if script.Parent.AmmoScript.Ammo.Value == 0 then return
| |
| end
| |
| script.Parent.AmmoScript.Ammo.Value = (script.Parent.AmmoScript.Ammo.Value - 1)
| |
|
| |
| 4) your weapon now has ammo. The value of the "Ammo" is how much ammo the gun has.
| |
| ]]
| |
|
| |
| Tool = script.Parent
| |
| function equip()
| |
| print("Equipped")
| |
| if game.Players.LocalPlayer ~= nil then
| |
| local m = Instance.new("Hint")
| |
| m.Parent = game.Players.LocalPlayer
| |
| while m ~= nil do
| |
| wait(0.1)
| |
| m.Text = "Ammo: "..script.Ammo.Value
| |
| end
| |
| end
| |
| end
| |
|
| |
| function unequip()
| |
| print("Unequipped")
| |
| if game.Players.LocalPlayer ~= nil then
| |
| print("localplayer found")
| |
| local m = game.Players.LocalPlayer:FindFirstChild("Message")
| |
| if m ~= nil then
| |
| m:remove()
| |
| end
| |
| end
| |
| end
| |
|
| |
| script.Parent.Equipped:connect(equip)
| |
| script.Parent.Unequipped:connect(unequip)
| |
|
| |
| </pre>
| |
|
| |
| ==NO FACE TOOL==
| |
|
| |
| *'''Name:''' The face removing tool of bordom tool 1b
| |
| *'''Type:''' Tool
| |
| *'''Author:''' {{User:Outofspace/sig}}
| |
| *'''Description:''' : Point this at someone's face for it to work. You can even look through it and modify parts to manipulate it power. "O_o" is the correct expression.
| |
|
| |
| <pre>
| |
| local hb = Instance.new("HopperBin")
| |
| hb.Parent = game.Players.PLAYERNAME.Backpack
| |
| hb.Name = "NILFACE"
| |
| local s = Instance.new("Script")
| |
| s.Parent = game.Players.PLAYERNAME.Backpack.NILFACE
| |
| s.Source = [[
| |
| bin = script.Parent
| |
| function onButton1Down(mouse)
| |
| if mouse.Target.Locked== true then
| |
| mouse.Target.face:Remove()
| |
| end
| |
| end
| |
| function onSelected(mouse)
| |
| mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
| |
| mouse.Button1Down:connect(function() onButton1Down(mouse) end)
| |
| end
| |
| bin.Selected:connect(onSelected)
| |
| ]]
| |
| s.Disabled = false
| |
| </pre>
| |
|
| |
| ==Cutscene Camera==
| |
|
| |
| *'''Name:''' Cutscene Camera
| |
| *'''Type:''' Camera/Cutscene
| |
| *'''Author:''' --[[User:Tgp1994|tgp1994]] 13:34, 24 August 2008 (CDT)
| |
| *'''Description:''' Everyone has probably seen the camera object, and some people have speculated making cutscenes with it. But no one has ever tried. I believe this is the first attempt at it. Basically, what this script does, is when it's parent is touched, will turn the Workspace camera into an actual "camera", follow whoever touched it, then it's up to you to move the brick that has the camera inside of it.
| |
| *'''Credits:''' [[Camera|The ROBLOX Wiki camera page]], [[Changing_The_Camera%27s_View]]
| |
| *'''Code:'''
| |
| <pre>local cam = game.Workspace.CurrentCamera
| |
| local isfollowing = false
| |
| function onTouched(hit)
| |
| if hit.Parent:findFirstChild("Humanoid") ~= nil and isfollowing == false then
| |
| game.Workspace.CurrentCamera.CameraType = 0
| |
| game.Workspace.CurrentCamera.Focus = CFrame.new(hit.Position)
| |
| game.Workspace.CurrentCamera.CoordinateFrame = CFrame.new(script.Parent.Position)
| |
| cam.CameraSubject = (hit)
| |
| isfollowing = true
| |
| doFollow(hit)
| |
| print("Camera changed.")
| |
| end
| |
| end
| |
|
| |
| connection = script.Parent.Touched:connect(onTouched)
| |
|
| |
| function doFollow(hit)
| |
|
| |
| while isfollowing == true do
| |
| wait(.09)
| |
| game.Workspace.CurrentCamera.Focus = CFrame.new(hit.Position)
| |
| game.Workspace.CurrentCamera.CoordinateFrame = CFrame.new(script.Parent.Position)
| |
| end
| |
|
| |
| end
| |
| </pre>
| |
|
| |
| ==User Database==
| |
|
| |
| *'''Name''' User Database
| |
| *'''Type''' Stats keeper
| |
| *'''Author''' UltimateYoshiMaster
| |
| *'''Description''' Holds stats for users that log on, that stay if they get log off and get back on the same server later. This example keeps track of how many times each player has respawned. You will need to create an empty model named "UserDatabase" and insert it into the script for it to work right.
| |
| *'''Code'''
| |
| <pre>
| |
| -------------------------------
| |
| --User Database script---
| |
| -------------------------------
| |
| --Keeps track of player info and saves it in the database
| |
| --This example keeps track of the number of times a player respawns
| |
|
| |
| function onPlayerEntered(newPlayer)
| |
| while true do
| |
| if newPlayer.Character ~= nil then break end
| |
| wait(5)
| |
| end
| |
| newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end )
| |
| setupPlayer(newPlayer)
| |
| end
| |
|
| |
| function onPlayerRespawn(property, player)
| |
| if property == "Character" and player.Character ~= nil then
| |
| setupPlayer(player)
| |
| end
| |
|
| |
| local database=script:findFirstChild("UserDatabase")
| |
| if(database:findFirstChild(player.Name)~=nil) then
| |
| local count = database:findFirstChild(player.Name):findFirstChild("Respawns")
| |
| count.Value=count.Value+1
| |
| end
| |
|
| |
| end
| |
|
| |
| function setupPlayer(player) --stuff to do when the player respawns or enters
| |
| print("Setup for player "..player.Name)
| |
| local database=script:findFirstChild("UserDatabase")
| |
|
| |
| if(database:findFirstChild(player.Name)==nil) then --create new record in the database and add variables
| |
| local entry = Instance.new("ObjectValue")
| |
| entry.Value = player
| |
| entry.Name = player.Name
| |
| entry.Parent = database
| |
|
| |
| local respawns = Instance.new("IntValue")
| |
| respawns.Value = 0
| |
| respawns.Name = "Respawns"
| |
| respawns.Parent = entry
| |
| end
| |
| end
| |
|
| |
| game.Players.ChildAdded:connect(onPlayerEntered)
| |
|
| |
| </pre>
| |
|
| |
|
| [[Category:Player Created]] | | [[Category:Player Created]] |