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: How do you edit a paintball gun?

Previous Thread :: Next Thread 
zapzing303 is not online. zapzing303
Joined: 05 Mar 2010
Total Posts: 1486
19 Feb 2012 09:54 PM
Recently, I have tried everything to get the paintball gun edited, and to work. It still hasn't worked, and I'm wondering if any of you know how.
Report Abuse
zapzing303 is not online. zapzing303
Joined: 05 Mar 2010
Total Posts: 1486
19 Feb 2012 09:56 PM
Bump.
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
19 Feb 2012 10:20 PM
Well what did you try to change?
Report Abuse
zapzing303 is not online. zapzing303
Joined: 05 Mar 2010
Total Posts: 1486
19 Feb 2012 10:38 PM
The damage and the Paintball shape.
Report Abuse
commonsensical is not online. commonsensical
Joined: 11 Jan 2012
Total Posts: 258
19 Feb 2012 10:49 PM
so, normally theres something labeled

dmg
damage
hit

and you change the number after that.
Report Abuse
zapzing303 is not online. zapzing303
Joined: 05 Mar 2010
Total Posts: 1486
19 Feb 2012 10:57 PM
I know how th change stuff. The gun always breaks though...
Report Abuse
CloneTrooper1019 is not online. CloneTrooper1019
Joined: 19 Jan 2009
Total Posts: 6227
19 Feb 2012 11:04 PM
Can you show me the script that is breaking?
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
20 Feb 2012 06:41 AM
Try removeing all the random letters and numbers from at the top of the script, then it should work.
Report Abuse
zapzing303 is not online. zapzing303
Joined: 05 Mar 2010
Total Posts: 1486
20 Feb 2012 11:12 AM
It's the same exact script, I DID remove all the stuff(but kept the local variable), I entered my ball properties into a brick through a script, and it worked. I don't no why the paintball gun doesn't.
Report Abuse
zapzing303 is not online. zapzing303
Joined: 05 Mar 2010
Total Posts: 1486
20 Feb 2012 11:12 AM
Bump.
Report Abuse
zapzing303 is not online. zapzing303
Joined: 05 Mar 2010
Total Posts: 1486
20 Feb 2012 12:34 PM
Bump.
Report Abuse
pinkball is not online. pinkball
Joined: 25 Mar 2009
Total Posts: 152
20 Feb 2012 12:45 PM
Show the script,so people easier can help you.
Report Abuse
zapzing303 is not online. zapzing303
Joined: 05 Mar 2010
Total Posts: 1486
20 Feb 2012 12:49 PM
Ok.
Report Abuse
zapzing303 is not online. zapzing303
Joined: 05 Mar 2010
Total Posts: 1486
20 Feb 2012 01:04 PM
I posted them in sections.


-----------------------------------------------------------
--Shooter
local tr = tool.Parent.Name
local player2 = game.Players:findFirstChild(tr)
local c = tr.TeamColor
local colors = {c}

function fire(v)

Tool.Handle.Fire:play()


local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)

local missile = Instance.new("Part")



local spawnPos = vCharacter.PrimaryPart.Position



spawnPos = spawnPos + (v * 8)

missile.Position = spawnPos
missile.Size = Vector3.new(1,1,1)
missile.Velocity = v * 100
missile.BrickColor = BrickColor.new(colors[math.random(1, #colors)])
missile.Shape = 0
missile.BottomSurface = 0
missile.TopSurface = 0
missile.Name = "Paintball"
missile.Elasticity = 0
missile.Reflectance = 0
missile.Friction = .9

local force = Instance.new("BodyForce")
force.force = Vector3.new(0,90,0)
force.Parent = missile

Tool.BrickCleanup:clone().Parent = missile

local new_script = script.Parent.Paintball:clone()
new_script.Disabled = false
new_script.Parent = missile

local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = vPlayer
creator_tag.Name = "creator"
creator_tag.Parent = missile



missile.Parent = game.Workspace

end



Tool.Enabled = true
function onActivated()

if not Tool.Enabled then
return
end

Tool.Enabled = false

local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end

local targetPos = humanoid.TargetPoint
local lookAt = (targetPos - character.Head.Position).unit

fire(lookAt)

wait(.08)

Tool.Enabled = true
end


script.Parent.Activated:connect(onActivated)

-----------------------------------------------------------
--Paintball
ball = script.Parent
damage = math.random(20,30)



function onTouched(hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")


if hit:getMass() < 1.2 * 200 then
hit.BrickColor = ball.BrickColor
end
-- make a splat
for i=1,3 do
local s = Instance.new("Part")
s.Shape = 1 -- block
s.formFactor = 2 -- plate
s.Size = Vector3.new(1,.4,1)
s.BrickColor = ball.BrickColor
local v = Vector3.new(math.random(-1,1), math.random(0,1), math.random(-1,1))
s.Velocity = 15 * v
s.CFrame = CFrame.new(ball.Position + v, v)
ball.BrickCleanup:clone().Parent = s
s.BrickCleanup.Disabled = false
s.Parent = game.Workspace

end


if humanoid ~= nil then
tagHumanoid(humanoid)
humanoid:TakeDamage(damage)
wait(2)
untagHumanoid(humanoid)
end

connection:disconnect()
ball.Parent = nil
end

function tagHumanoid(humanoid)
-- todo: make tag expire
local tag = ball:findFirstChild("creator")
if tag ~= nil then
local new_tag = tag:clone()
new_tag.Parent = humanoid
end
end


function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then
tag.Parent = nil
end
end
end

connection = ball.Touched:connect(onTouched)

wait(40)
ball.Parent = nil
---------------------------------------------------------
--Gui
local Tool = script.Parent

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

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

wait(.08)
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)
-----------------------------------------------------------------------
--Cleanup
wait(0.5)
script.Parent.Parent = nil
Report Abuse
zapzing303 is not online. zapzing303
Joined: 05 Mar 2010
Total Posts: 1486
20 Feb 2012 01:05 PM
In the random stuff I found stuff that I need. So I kept the variables.

It just doesn't shoot.
Report Abuse
zapzing303 is not online. zapzing303
Joined: 05 Mar 2010
Total Posts: 1486
20 Feb 2012 01:28 PM
Bump.
Report Abuse
zapzing303 is not online. zapzing303
Joined: 05 Mar 2010
Total Posts: 1486
20 Feb 2012 01:38 PM
Guess who's bumping? Bump.
Report Abuse
zapzing303 is not online. zapzing303
Joined: 05 Mar 2010
Total Posts: 1486
20 Feb 2012 01:51 PM
NVM I think I found it. :P
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