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: Please Anyone Have A Script To Help Me

Previous Thread :: Next Thread 
hockeydevil18 is not online. hockeydevil18
Joined: 09 Jun 2011
Total Posts: 22
08 Mar 2014 05:39 PM
I have my leaderboard setup but whenever I kill someone with the gun I made it doesn't add a KO is there a certain script I have to add?
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
08 Mar 2014 05:54 PM
No. Modify the gun script to put in an object value called "creator" inside the humanoid whenver it damages someone. If you dont get that lrn2lua
Report Abuse
hockeydevil18 is not online. hockeydevil18
Joined: 09 Jun 2011
Total Posts: 22
08 Mar 2014 06:13 PM
Does anyone know what I need to add to my script my script is

local tool = script.Parent
local user


tool.Equipped:connect(function(mouse)

user = tool.Parent


mouse.Button1Down:connect(function()

local ray = Ray.new(tool.Handle.CFrame.p, (mouse.Hit.p - tool.Handle.CFrame.p).unit*300)
local hit, position = game.Workspace:FindPartOnRay(ray, user)


local humanoid = hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid:TakeDamage(50)
end


local distance = (position - tool.Handle.CFrame.p).magnitude
local rayPart = Instance.new("Part", user)
rayPart.Name = "RayPart"
rayPart.BrickColor = BrickColor.new("Bright red")
rayPart.Transparency = 0.5
rayPart.Anchored = true
rayPart.CanCollide = false
rayPart.TopSurface = Enum.SurfaceType.Smooth
rayPart.BottomSurface = Enum.SurfaceType.Smooth
rayPart.formFactor = Enum.FormFactor.Custom
rayPart.Size = Vector3.new(0.2, 0.2, distance)
rayPart.CFrame = CFrame.new(position, tool.Handle.CFrame.p) * CFrame.new(0, 0, -distance/2)


game.Debris:AddItem(rayPart, 1)
end)
end)

local Tool = script.Parent;

enabled = true
function onButton1Down(mouse)
if not enabled then
return
end

enabled = false
mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"

wait(.5)
mouse.Icon = "rbxasset://textures\\GunCursor.png"
enabled = true

end

function onEquippedLocal(mouse)

if mouse == nil then
print("Mouse not found")
return
end

mouse.Icon = "rbxasset://textures\\GunCursor.png"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end


Tool.Equipped:connect(onEquippedLocal)

Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
08 Mar 2014 06:46 PM
repeat until nil on Line 1.
Report Abuse
hockeydevil18 is not online. hockeydevil18
Joined: 09 Jun 2011
Total Posts: 22
08 Mar 2014 10:03 PM
Thanks
Report Abuse
hockeydevil18 is not online. hockeydevil18
Joined: 09 Jun 2011
Total Posts: 22
08 Mar 2014 10:12 PM
It didn't work please anyone know :(
Report Abuse
hockeydevil18 is not online. hockeydevil18
Joined: 09 Jun 2011
Total Posts: 22
08 Mar 2014 10:24 PM
bump
Report Abuse
hockeydevil18 is not online. hockeydevil18
Joined: 09 Jun 2011
Total Posts: 22
09 Mar 2014 10:16 AM
bump
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