|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 08 Mar 2014 06:46 PM |
| repeat until nil on Line 1. |
|
|
| Report Abuse |
|
|
| |
|
|
| 08 Mar 2014 10:12 PM |
| It didn't work please anyone know :( |
|
|
| Report Abuse |
|
|
| |
|
| |
|