tom2cuteJoin Date: 2010-05-03 Post Count: 8544 |
I took the dodgeball model from ROBLOX Battle and placed it in my dodgeball game, without teams the ball doesn't damage people, with teams the ball still doesn't damage people? What line am I missing which indicates why it's not working?
print("Running cannon ball script")
local ball = script.Parent
local function WaitForChild(parent, childName)
while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
return parent[childName]
end
--local KILL_FEED_ICON_URL = 'rbxasset://Textures/Superball.png'
local START_DAMAGE = 42
local MIN_DAMAGE = 10
local DECAY_RATIO = 1 / 1.65
local VELOCITY_DAMPING = 0.9
local BOING_VOLUME = 0.666
local damage = START_DAMAGE
local DebrisService = Game:GetService('Debris')
local BounceScript = WaitForChild(script, 'BounceEffect')
local IsMoneyBall= WaitForChild(script,'IsMoneyBall')
local MyHumanoid
local r = game:service("RunService")
local last_sound_time = r.Stepped:wait() - 0.2
local LastHitCharacter
local LastDamageHumanoid = nil
local DecalHolder = Instance.new("Part")
DecalHolder.Size = Vector3.new(2, 2, 2)
DecalHolder.Anchored = true
DecalHolder.CanCollide = false
DecalHolder.Transparency = 0.5
DecalHolder.Reflectance = 0
DecalHolder.FormFactor = Enum.FormFactor.Custom
DecalHolder.Shape = Enum.PartType.Block
DecalHolder.Size = Vector3.new(0.1, 0.1, 0.1)
DecalHolder.BottomSurface = 0
DecalHolder.TopSurface = 0
DecalHolder.Name = "Bounce Spot"
local DecalMesh = Instance.new('SpecialMesh')
DecalMesh.Name = "BounceMesh"
DecalMesh.MeshType = Enum.MeshType.Sphere
DecalMesh.Scale = Vector3.new(1,1,1)
DecalMesh.Parent = DecalHolder
local MoneySound = Instance.new('Sound')
MoneySound.Name = 'MoneySound'
MoneySound.SoundId = 'http://www.roblox.com/Asset?ID=97688233'
MoneySound.Volume = 1
MoneySound.Parent=DecalHolder
function FindHumanoidRecursive(p)
if (p.className == Workspace) then return nil end
local h = p:FindFirstChild("Humanoid")
if (h ~= nil) then return h end
if (p.Parent ~= nil) then return FindHumanoidRecursive(p.Parent) end
return nil
end
local function CheckAwardSuperballRicochet(humanoid, damage)
local creatorTag = ball:FindFirstChild('creator')
local myHumanoid = creatorTag and
creatorTag.Value and
creatorTag.Value.Character and
creatorTag.Value.Character:FindFirstChild('Humanoid')
--print("Checking rico myHumanoid is" , myHumanoid , "other humanoid is:" , humanoid)
if myHumanoid and humanoid ~= myHumanoid and humanoid.Health <= damage and
LastDamageHumanoid and LastDamageHumanoid ~= humanoid then
--print("awarding ricochet")
_G.AwardBadge(creatorTag.Value, 3)
end
end
function CreateBounceEffect(position)
local DecalCopy = DecalHolder:Clone()
DecalCopy.Size = ball.Size
DecalCopy.BrickColor = ball.BrickColor
DecalCopy.CFrame = CFrame.new(position)
DebrisService:AddItem(DecalCopy, 2)
DecalCopy.Parent = Workspace
local bounceCopy = BounceScript:Clone()
bounceCopy.Parent = DecalCopy
bounceCopy.Disabled = false
Spawn(function()
wait(0)
if IsMoneyBall.Value and DecalCopy then
DecalCopy.MoneySound:Play()
end
end)
end
function onTouched(hit)
local myHumanoid
local creatorTag = ball:FindFirstChild('creator')
if creatorTag and creatorTag.Value and creatorTag.Value.Character then
myHumanoid = creatorTag.Value.Character:FindFirstChild('Humanoid')
end
local humanoid = FindHumanoidRecursive(hit)
if humanoid~=nil then -- make sure not to damage yourself unless it has bounced already
if myHumanoid and (humanoid ~= myHumanoid or damage < START_DAMAGE) and
(not LastHitCharacter or humanoid.Parent ~= LastHitCharacter) then
LastHitCharacter = humanoid.Parent
--TagHumanoid(humanoid, ball.creator.Value)
--humanoid:TakeDamage(damage)
local hitBindable = humanoid:FindFirstChild('Hit')
if hitBindable then
local wasAlive = humanoid.Health > 0
LastDamageHumanoid = humanoid
hitBindable:Invoke(damage, ball:FindFirstChild('creator'))
if wasAlive and humanoid.Health <= 0 then
CheckAwardSuperballRicochet(humanoid, damage)
end
else
print("Could not find BindableFunction 'Hit'")
end
end
else
local now = r.Stepped:wait()
if (now - last_sound_time > 0.32) then
ball.Boing.Volume = math.max(0.17, math.min(BOING_VOLUME, BOING_VOLUME * ball.Velocity.magnitude / 130))
--print(ball.Boing.Volume)
ball.Boing:play()
last_sound_time = now
damage = math.max(MIN_DAMAGE, damage * DECAY_RATIO)
--ball.Velocity = ball.Velocity * VELOCITY_DAMPING
CreateBounceEffect(ball.Position)
end
if now - last_sound_time > 0.3 then
print("Resetting last hit character")
LastHitCharacter = nil
end
end
end
--[[
function TagHumanoid(humanoid, player)
print("Tagging player as creator:" , player.Name , "as damaging" , humanoid.Name , tick())
-- Add more tags here to customize what tags are available.
while humanoid:FindFirstChild('creator') do
humanoid:FindFirstChild('creator'):Destroy()
end
local creatorTag = Instance.new("ObjectValue")
creatorTag.Value = player
creatorTag.Name = "creator"
creatorTag.Parent = humanoid
DebrisService:AddItem(creatorTag, 2)
local weaponIconTag = Instance.new("StringValue")
weaponIconTag.Value = KILL_FEED_ICON_URL
weaponIconTag.Name = "icon"
weaponIconTag.Parent = creatorTag
end
--]]
connection = ball.Touched:connect(onTouched)
DebrisService:AddItem(ball, 2) |
|
tom2cuteJoin Date: 2010-05-03 Post Count: 8544 |
mh |
|
|
tom2cuteJoin Date: 2010-05-03 Post Count: 8544 |
Give me a legitimate reason first. |
|
tom2cuteJoin Date: 2010-05-03 Post Count: 8544 |
Mhm |
|
tom2cuteJoin Date: 2010-05-03 Post Count: 8544 |
hi |
|
|
You don't just take something.
Learn from it, and then make your own. |
|
|
How about learning how comment lines are made and searching up "Damage".
Doing that, you'd realize the damage part is commented out of the actual script thus never executed. |
|
tom2cuteJoin Date: 2010-05-03 Post Count: 8544 |
why does it work in ROBLOX battle then |
|
tom2cuteJoin Date: 2010-05-03 Post Count: 8544 |
mhmhmhm |
|
tom2cuteJoin Date: 2010-05-03 Post Count: 8544 |
ahhhhhhhhhhhh |
|
tom2cuteJoin Date: 2010-05-03 Post Count: 8544 |
awwwwwww |
|
tom2cuteJoin Date: 2010-05-03 Post Count: 8544 |
meaniessssssssssssss |
|
|
well, basically what i did is i took a free dodgeball in the models in roblox studio and then i saw that the dodgeball i took damages people. so when you type "dodgeball" into the search bar for free models, you will see several options. so ask your friend to help you try out all the first 4 dodgeballs that will show up and see if they damage anybody. Hope this helped! |
|
|
You bumped an old thread. |
|
llaserxJoin Date: 2011-12-10 Post Count: 53069 |
|
|
tom2cuteJoin Date: 2010-05-03 Post Count: 8544 |
That kid's first post was on my thread, what a scrub he is. Oh and I fixed it so get rekt. |
|