|
local function onRespawn(character) -- Should the local be here?
local mesg = Instance.new("Message")
local random = math.Random(1,6)
mesg.Parent = game.Players:getPlayerFromCharacter(character)
if random == 1 then
mesg.Text = "You got enhanced health!"
character.Humanoid.MaxHealth = 250
character.Humanoid.Health = 250
wait(3)
mesg:Remove()
elseif random == 2 then
mesg.Text = "WalkSpeed Doubled!"
character.Humanoid.WalkSpeed = 32
mesg:Remove()
elseif random == 3 then
mesg.Text = "You got enhanced weapons!"
local weparent = game.Lighting.EnhancedWeapons
local wep1 = weparent.EnhancedSword:clone()
local wep2 = weparent.FastBomb:clone()
local wep3 = weparent.EnhancedSlingshot:clone()
local wep4 = weparent.FastRocket:clone()
local wep5 = weparent.ExtendedTrowel:clone()
local wep6 = weparent.EnhancedPaintballGun:clone()
local wep7 = weparent.UltraSuperball:clone()
local bp = game.Players:getPlayerFromCharacter(character).Backpack
bp.LinkedSword:Remove()
bp.LinkedTimebomb:Remove()
bp.LinkedSlingshot:Remove()
bp.LinkedRocketLauncher:Remove()
bp.LinkedTrowel:Remove()
bp.LinkedPaintballGun:Remove()
bp.LinkedSuperball:Remove()
wep1.Parent = bp
wep2.Parent = bp
wep3.Parent = bp
wep4.Parent = bp
wep5.Parent = bp
wep6.Parent = bp
wep7.Parent = bp
wait(3)
mesg:Remove()
elseif random == 4 then
mesg.Text = "Forcefield for 30 seconds!"
ff = Instance.new("ForceField")
ff.Parent = character
wait(3)
mesg:Remove()
wait(27)
ff:remove()
elseif random == 5 then
mesg.Text = "Sorry! You get nothing."
elseif random == 6 then
mesg.Text "Invisibility!"
character.Head.Transparency = 1
character.Torso.Transparency = 1
character:findFirstChild("Right Arm").Transparency = 1
character:findFirstChild("Left Arm").Transparency = 1
character:findFirstChild("Right Leg").Transparency = 1
character:findFirstChild("Left Leg").Transparency = 1
character.Head.face:Remove()
wait(3)
mesg:Remove()
end
end
local function onPlayerEntered(newPlayer) -- Should the local be here too?
newPlayer.CharacterAdded:connect(onRespawn)
end
game.Players.PlayerAdded:connect(onPlayerEntered)
This gives you a random bonus like better weapons for brickbattle, higher health, or invisibility. This script wont work though. I tried it twice. |
|
SpectrumwJoin Date: 2009-08-04 Post Count: 13510 |
Remove the local before function... |
|
|
Note: The output has nothing |
|
sncplay42Join Date: 2008-11-27 Post Count: 11891 |
@Spectrum "local function" is valid |
|
|
|
sncplay42Join Date: 2008-11-27 Post Count: 11891 |
If you're testing it in Play Solo it won't work because the player is there before the script runs and connects to PlayerAdded.
Try testing it with Test>Start Server and Test>Start Player. |
|
SpectrumwJoin Date: 2009-08-04 Post Count: 13510 |
Strange... i went through all these 70 lines and i could not find a single scripting mistake, maybe you made a typing error or something like that. |
|
|
Apparently roblox wont except the capital R in math.Random |
|
|
Works fine now, except for the sheer fact that my enhanced weapons wont work
|
|
|
Apparently, somethings wrong with the first line of each weapon's script |
|
|
If there was a spelling error it would show in the output. |
|
|
Output for enhanced weps
Sun Oct 31 15:29:35 2010 - Running Script 'SwordScript'
Sun Oct 31 15:29:35 2010 - Players.Player.Backpack.EnhancedSword.SwordScript:1: unexpected symbol near '%'
Sun Oct 31 15:29:35 2010 - Running Script 'PlantBomb'
Sun Oct 31 15:29:35 2010 - Players.Player.Backpack.FastBomb.PlantBomb:1: unexpected symbol near '%'
Sun Oct 31 15:29:35 2010 - Running Script 'Slingshot'
Sun Oct 31 15:29:35 2010 - Players.Player.Backpack.EnhancedSlingshot.Slingshot:1: unexpected symbol near '%'
Sun Oct 31 15:29:35 2010 - Running Script 'Server Launcher'
Sun Oct 31 15:29:35 2010 - Players.Player.Backpack.FastRocket.Server Launcher:1: unexpected symbol near '%'
Sun Oct 31 15:29:35 2010 - Running Script 'WallMaker'
Sun Oct 31 15:29:35 2010 - Players.Player.Backpack.ExtendedTrowel.WallMaker:1: unexpected symbol near '%'
Sun Oct 31 15:29:35 2010 - Running Script 'PaintballShooter'
Sun Oct 31 15:29:35 2010 - Players.Player.Backpack.EnhancedPaintballGun.PaintballShooter:1: unexpected symbol near '%'
Sun Oct 31 15:29:35 2010 - Running Script 'CannonScript'
Sun Oct 31 15:29:35 2010 - Players.Player.Backpack.UltraSuperball.CannonScript:1: unexpected symbol near '%'
Parts of script:
Sword:%B7Yc4g3cVF2vsIKTu48R1nScXPd5Vo60+xN0Q76AakHULM5fe1mr5zRUX5JSWoGHEo1edTgpe64xv21qdoLhD/SPEfbcHqsq1yly+4qaywNLH/YfQ7Hg7BosLHdrvJ45miA7slD6WHxMwAIne/oTw6Xs2G7dH4j1MSnDIsxiy8I=%%1014475%-------- OMG HAX
SlingShot:%eF2mjcBVmfKadNSpqkNtVSG6Ja4HkHYHFDbOjvnYPsRx29iI6/HD66BOpK3X5XXr6IP3z+avb/MTP8RDSwbIVeGvngUAESw+dI21IQKYTSvS84QnAMNvjJ20V7qYA2C5j/PPsLLPjI8c6URKlD0PC0MlHz5RnhQx8C5SCdchS/o=%%1014651%Tool = script.Parent
Paintball:%A+onLyEr7tQ0KGisb1Q3qpsgHmUTyq3eWYRs1Kcok0wVqbaEisFv/qwP5TN+rdQdSutm4zPV0M/kR9s1hokdD+PjjHdXeULgr0WYnVNC2TdGuE79pf5SHiLZa77YnSgzzQ66VnBRZcPXxndI0IhjpTzIKfxec/9j9CiQhhlL1JM=%%1014542%Tool = script.Parent
Trowel:%eECK/fqlBRPVVVF4lyt83ZL5Pt6pSBxwrsUuEZlfHLyKN1rfReq2vOppuJSSVBHqIoLXsOjXnS1Pog7iDTIL6UAj5yI+szADBsf7AZKtxVcj9T5wZWUetIzwDfl07ZxC8U4bnJb+boLXU58RFS6o1pLzI4Putv98LpGeH6wltxk=%%1014611%wallWidth = 12
Bomb:%btUQya9HgX/b3AGJnHPXQcULmTzpUsZ24mUcKOJfhtAqXMnCtR9a30yzFk97MAAtlV1pNl/xHDe7rk/ZR72Y+imjIcfhTJnPlfLHqHzNehIIiHHC+y20F4GkJe0qcbe3TCjoIjXLsJz41HK7n5btPNk5BvsN3F3woCkGsv6ALog=%%1014618%bombScript = script.Parent.Bomb
Rocket:%PgAo5NXYQWGR088G2UGlnjrWe4B9yr3Nhio8AFSDJteW1E8VSsdOqDg+qJF8A6LBT/yRJAy/ejO4SANe7P8oqHYHHPrgDreIKn6FhM3xW8AMWsveZ0paJfRbVrpXyMdxuhwV0KUuXskt+J+Y34EOrmVer/OkvQhC0fTm4KarWvU=%%1014655%r = game:service("RunService")
Superball:%NsitmtnLWrnBO6y2N1YhfEn51qRoNGPlSmifm5I46SPyDB6N9pwBl7PcXku0Kppqng6k8+oxg6kU5hK6mOfPouZhQm83eQI6+MvDpCy+VKbbigxESVhQBGAxgzUXRKy5sl2bZSTX+n4Lme96Pw5MFW1HgGPJG8heZ/eIpy29geM=%%1014633%Tool = script.Parent
These are the first lines of the wep script |
|
|