null
nil
-
true
0
0.400000006
0.5
1
0
-0
0
0
1
0
-1
-0
ClassicPaintballGun
rbxasset://Textures\Gun.png
true
-
true
Paintball
ball = script.Parent
damage = 99
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(8)
ball.Parent = nil
true
-
false
Mouselcon
local MOUSE_ICON = 'rbxasset://textures/GunCursor.png'
local RELOADING_ICON = 'rbxasset://textures/GunWaitCursor.png'
local Tool = script.Parent
local Mouse = nil
local function UpdateIcon()
if Mouse then
Mouse.Icon = Tool.Enabled and MOUSE_ICON or RELOADING_ICON
end
end
local function OnEquipped(mouse)
Mouse = mouse
UpdateIcon()
end
local function OnChanged(property)
if property == 'Enabled' then
UpdateIcon()
end
end
Tool.Equipped:connect(OnEquipped)
Tool.Changed:connect(OnChanged)
true
-
false
PaintballShooter
Tool = script.Parent
colors = {45, 119, 21, 24, 23, 105, 104}
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(999,999,999)
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(0.0)
Tool.Enabled = true
end
script.Parent.Activated:connect(onActivated)
true
-
true
BrickCleanup
-- this script removes its parent from the workspace after 120 seconds
wait(120)
script.Parent.Parent = nil
true
-
false
-0.5
0.5
0
0
-0.5
0.5
0
0
194
-126.5
18.5614147
-533.169067
-1
1.89381143e-021
3.3761821e-021
-3.86455228e-021
-0.53896153
-0.842330396
2.24417498e-022
-0.842330396
0.53896153
false
false
0.5
0
0.300000012
-0.5
0.5
0
0
-0.5
0.5
0
0
false
256
Handle
0
-0.5
0.5
0
0
7.42923705e-022
3.7162543e-022
5.06054397e-022
-0.5
0.5
0
0
0
3.58094953e-020
-0.130611092
3.87478864e-020
true
1
1
3
2
-
2
2
rbxasset://fonts/PaintballGun.mesh
5
Mesh
0
0
0
10
10
9
rbxasset://textures/PaintballGunTex128.png
1
1
1
true
-
false
Fire
1
-1
false
rbxasset://sounds\\paintball.wav
1
true