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: I need to know how to...

Previous Thread :: Next Thread 
Noahjw17 is not online. Noahjw17
Joined: 21 Jan 2013
Total Posts: 107
02 Apr 2014 02:58 PM
I need to know how to make it so that when someone kills a zombie running around in my tycoon game, the get (number) points. So they kill "King zombie" and recieve 1,000 points, which they can use to buy a "turret" for 1,000 points. Get it?
Report Abuse
Noahjw17 is not online. Noahjw17
Joined: 21 Jan 2013
Total Posts: 107
02 Apr 2014 03:00 PM
this is getting crushed
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
02 Apr 2014 03:02 PM
Do your weapons/tools 'tag' the zombies they hit?
Report Abuse
4colby13 is not online. 4colby13
Joined: 02 Feb 2013
Total Posts: 302
02 Apr 2014 03:04 PM
http://www.roblox.com/Points-on-Kill-Leaderboard-FAV-BEFORE-TAKING-item?id=69948585
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
02 Apr 2014 03:10 PM
--In the sword, if it's a gun then you'll have to put this in the raycast part., edit the 'Leaderstats' and 'Points' to the names of your leaderstats and points values.

local x = --Amount of points for killing normal zombie

script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
--Damage
if hit.Parent.Humanoid.Health == 0 then
if hit.Parent.Name == "King zombie" then
local plr = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
plr.Leaderstats.Points = plr.Leaderstats.Points + 1000
else
plr.Leaderstats.Points = plr.Leaderstats.Points + x
end end end end end)

--Make a gui and put a TextButton in it for buying the turret and put this script in the TextButton, put the turret in lighting and name it 'Turret', again edit the 'Leaderstats' and 'Points' to the names of your leaderstats and points values.

script.Parent.MouseButton1Down:connect(function()
pts = game.Players.LocalPlayer.Leaderstats
if pts.Points >= 1000 then
pts.Points = pts.Points - 1000
game.Lighting.Turret:Clone().Parent = game.Players.LocalPlayer.Backpack
end end)
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