Cenva
|
  |
| Joined: 19 Feb 2012 |
| Total Posts: 60 |
|
|
| 25 Apr 2012 09:52 AM |
Hey guys, it's me again! I've got a question. So, I have this item called "Battle Armor" that is a power-up in my Tycoon game. When a humanoid obtains it, I want a sparkle effect to be applied to their torso. Can someone volunteer to help me with this, that way I can send you the script (private message) and you could help me edit it?
Eternal thanks :) |
|
|
| Report Abuse |
|
|
PvcPipe
|
  |
| Joined: 21 Jul 2010 |
| Total Posts: 68 |
|
|
| 25 Apr 2012 09:58 AM |
How do you get the item, do you step on a block or click a block? Post the script. |
|
|
| Report Abuse |
|
|
Cenva
|
  |
| Joined: 19 Feb 2012 |
| Total Posts: 60 |
|
|
| 25 Apr 2012 10:24 AM |
alright, the script is below.
-- Touching this Battle Armor doubles you MaxHealth and heals you to full power
local debounce = false
function getPlayer(humanoid) -- find the owning player of a humanoid. local players = game.Players:children() for i = 1, #players do if players[i].Character ~= nil then if players[i].Character.Humanoid == humanoid then return players[i] end end end return nil end
function putOnArmor(humanoid)
local torso = humanoid.Parent.Torso
torso.Reflectance = .6 humanoid.MaxHealth = 200 local player = getPlayer(humanoid) if player ~= nil then local message = Instance.new("Message") message.Text = "You found Battle Armor!" message.Parent = player wait(5) message.Text = "Max Health Doubled!" wait(5) message.Parent = nil end
end
function hasArmor(humanoid) return (humanoid.MaxHealth > 100) end
function onTouched(hit) local humanoid = hit.Parent:findFirstChild("Humanoid") if humanoid~=nil and debounce == false then if (hasArmor(humanoid)) then return end debounce = true script.Parent.Parent = nil putOnArmor(humanoid) debounce = false end end
script.Parent.Touched:connect(onTouched)
i want an event in the script that makes the torso have a purple sparkle effect for the player that touches the armor. :D |
|
|
| Report Abuse |
|
|
Cenva
|
  |
| Joined: 19 Feb 2012 |
| Total Posts: 60 |
|
| |
|
PvcPipe
|
  |
| Joined: 21 Jul 2010 |
| Total Posts: 68 |
|
|
| 25 Apr 2012 11:19 AM |
-- Touching this Battle Armor doubles you MaxHealth and heals you to full power
local debounce = false
function getPlayer(humanoid) -- find the owning player of a humanoid. local players = game.Players:children() for i = 1, #players do if players[i].Character ~= nil then if players[i].Character.Humanoid == humanoid then return players[i] end end end return nil end
function putOnArmor(humanoid)
local torso = humanoid.Parent.Torso
local sparkles = Instance.new("Sparkles") sparkles.Parent = torso
torso.Reflectance = .6 humanoid.MaxHealth = 200
local player = getPlayer(humanoid) if player ~= nil then local message = Instance.new("Message") message.Text = "You found Battle Armor!" message.Parent = player wait(5) message.Text = "Max Health Doubled!" wait(5) message.Parent = nil end
end
function hasArmor(humanoid) return (humanoid.MaxHealth > 100) end
function onTouched(hit) local humanoid = hit.Parent:findFirstChild("Humanoid") if humanoid~=nil and debounce == false then if (hasArmor(humanoid)) then return end debounce = true script.Parent.Parent = nil putOnArmor(humanoid) debounce = false end end
script.Parent.Touched:connect(onTouched)
--That should work. |
|
|
| Report Abuse |
|
|
Cenva
|
  |
| Joined: 19 Feb 2012 |
| Total Posts: 60 |
|
| |
|
Cenva
|
  |
| Joined: 19 Feb 2012 |
| Total Posts: 60 |
|
|
| 25 Apr 2012 12:10 PM |
hey could you mod this script to apply a sparkle effect to the torso that is removed after 10 seconds? (after the speed effect is removed)
Thanks in advance :D
local Tool = script.Parent;
local GlassBreak = Instance.new("Sound") GlassBreak.Name = "GlassBreak" GlassBreak.SoundId = "http://www.roblox.com/asset/?id=11415738" GlassBreak.Volume = 1 GlassBreak.Parent = Tool.Handle
local DrinkSound = Instance.new("Sound") DrinkSound.Name = "Drink" DrinkSound.SoundId = "http://www.roblox.com/asset/?id=10722059" DrinkSound.Volume = .5 DrinkSound.Parent = Tool.Handle
function onActivated() if not Tool.Enabled then return end
Tool.Enabled = false Tool.GripForward = Vector3.new(0,-.759,-.651) Tool.GripPos = Vector3.new(1.5,-.35,.1) Tool.GripRight = Vector3.new(1,0,0) Tool.GripUp = Vector3.new(0,.651,-.759)
DrinkSound:Play() DrinkSound:Remove() wait(0.1) local h = Tool.Parent:FindFirstChild("Humanoid") if (h ~= nil) then h.WalkSpeed = h.WalkSpeed + 40 Tool:remove() wait(10) h.WalkSpeed = h.WalkSpeed - 40 wait(1) --Tool:remove() else return end
Tool.GripForward = Vector3.new(-.976,0,-0.217) Tool.GripPos = Vector3.new(0.1,0,.1) Tool.GripRight = Vector3.new(.217,0,-.976) Tool.GripUp = Vector3.new(0,1,0)
wait(1)
local p = Tool.Handle:Clone() GlassBreak.Parent = p p.Transparency = 0 Tool.Parent.Torso["Right Shoulder"].MaxVelocity = 0.7 Tool.Parent.Torso["Right Shoulder"].DesiredAngle = 3.6 wait(.1) Tool.Parent.Torso["Right Shoulder"].MaxVelocity = 1
local dir = h.Parent.Head.CFrame.lookVector p.Velocity = (dir * 60) + Vector3.new(0,30,0) p.CanCollide = true Tool.Glass.Parent = p p.Glass.Disabled = false p.Parent = game.Workspace
script.Parent:Remove()
end
function onEquipped() --Tool.Handle.OpenSound:play() end
script.Parent.Activated:connect(onActivated) script.Parent.Equipped:connect(onEquipped)
|
|
|
| Report Abuse |
|
|
Cenva
|
  |
| Joined: 19 Feb 2012 |
| Total Posts: 60 |
|
| |
|
PvcPipe
|
  |
| Joined: 21 Jul 2010 |
| Total Posts: 68 |
|
|
| 25 Apr 2012 01:01 PM |
| Sorry, I don't understand that second script so I can't modify it. |
|
|
| Report Abuse |
|
|