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: Sword Dialog Damage Indicator

Previous Thread :: Next Thread 
hung999 is not online. hung999
Joined: 19 Sep 2008
Total Posts: 819
10 Nov 2011 10:23 PM
Could someone tell me how I would script a sword so that it would make a dialog and show how much damage you dealt such as in Benjamint and Ninjakid09 RPG
Report Abuse
benningtonguy is not online. benningtonguy
Joined: 21 Dec 2008
Total Posts: 18166
10 Nov 2011 10:25 PM
game:Chat(Vector3 position, damage, chatcolor)


Happy?
Report Abuse
hung999 is not online. hung999
Joined: 19 Sep 2008
Total Posts: 819
10 Nov 2011 10:27 PM
I don't understand .
Report Abuse
benningtonguy is not online. benningtonguy
Joined: 21 Dec 2008
Total Posts: 18166
10 Nov 2011 10:28 PM
Well, I could make you the script, but I need a sword script and variables to work with.
Report Abuse
hung999 is not online. hung999
Joined: 19 Sep 2008
Total Posts: 819
10 Nov 2011 10:30 PM
Aight , Lots of Thanks ! I'll send you the sword it's in my models .
Report Abuse
hung999 is not online. hung999
Joined: 19 Sep 2008
Total Posts: 819
10 Nov 2011 10:44 PM
rwar
Report Abuse
hung999 is not online. hung999
Joined: 19 Sep 2008
Total Posts: 819
11 Nov 2011 12:20 AM
bump
Report Abuse
hung999 is not online. hung999
Joined: 19 Sep 2008
Total Posts: 819
11 Nov 2011 01:08 AM
weeeelll ?
Report Abuse
RoboTestGear is not online. RoboTestGear
Joined: 28 Dec 2009
Total Posts: 3063
11 Nov 2011 02:38 AM
game:GetService("Chat"):Chat(game.Workspace.Part,"Hello!",Enum.ChatColor.Red)
Report Abuse
hung999 is not online. hung999
Joined: 19 Sep 2008
Total Posts: 819
11 Nov 2011 01:15 PM
Whaaa ? Could someone script it for me ? Sorry :/
Report Abuse
hung999 is not online. hung999
Joined: 19 Sep 2008
Total Posts: 819
11 Nov 2011 02:17 PM
bump
Report Abuse
k9lego is not online. k9lego
Joined: 24 Dec 2008
Total Posts: 552
11 Nov 2011 02:25 PM
I will!
Report Abuse
k9lego is not online. k9lego
Joined: 24 Dec 2008
Total Posts: 552
11 Nov 2011 02:28 PM
Never mind, I don't know how.
Report Abuse
hung999 is not online. hung999
Joined: 19 Sep 2008
Total Posts: 819
11 Nov 2011 04:00 PM
D:
Report Abuse
hung999 is not online. hung999
Joined: 19 Sep 2008
Total Posts: 819
11 Nov 2011 06:25 PM
bump
Report Abuse
hung999 is not online. hung999
Joined: 19 Sep 2008
Total Posts: 819
11 Nov 2011 07:17 PM
This wont work try fixing it

r = game:service("RunService")
ching = false
sword = script.Parent.Handle
Tool = script.Parent
function blow(hit)
if ching == true then return end
local humanoid = hit.Parent:findFirstChild("Enemy")
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
if humanoid~=nil then
ching = true
print("SWORD HIT")
tagHumanoid(humanoid, vPlayer)
local damage = math.random(0,8)
humanoid:TakeDamage(damage)
local gui=Instance.new("BillboardGui")
gui.Parent=newPlayer.Character.Head
gui.Adornee=newPlayer.Character.Head
gui.Size=UDim2.new(3,0,3,0)
gui.StudsOffset=Vector3.new(0.5,2,0)
local text = Instance.new("TextLabel")
text.Size = UDim2.new(0,50,0,50)
text.Position = UDim2.new(0.45,0,0.25,0)
text.Parent = part
if (damage == 0) then
text.BackgroundColor3 = Color3.new(0/255,102/255,255/255)
text.BackgroundTransparency = 0.5
text.BorderSizePixel = 0.5
else
text.BackgroundColor3 = Color3.new(255/255,51/255,0/255)
text.BackgroundTransparency = 0.5
text.BorderSizePixel = 0.5
end
text.Text = ""..damage..""
wait(2)
ching = false
part:remove()
wait(.1)
untagHumanoid(humanoid)
end
end



function tagHumanoid(humanoid, player)
local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = player
creator_tag.Name = "creator"
creator_tag.Parent = humanoid
end

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


function attack()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Slash"
anim.Parent = Tool
end

function lunge()

local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Lunge"
anim.Parent = Tool


force = Instance.new("BodyVelocity")
force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
force.Parent = Tool.Parent.Torso
wait(.25)
swordOut()
wait(.25)
force.Parent = nil
wait(.5)
swordUp()

damage = slash_damage
end

function swordUp()
Tool.GripForward = Vector3.new(-1,0,0)
Tool.GripRight = Vector3.new(0,1,0)
Tool.GripUp = Vector3.new(0,0,1)
end

function swordOut()
Tool.GripForward = Vector3.new(0,0,1)
Tool.GripRight = Vector3.new(0,-1,0)
Tool.GripUp = Vector3.new(-1,0,0)
end

function swordAcross()
-- parry
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

attack()

wait(1)

Tool.Enabled = true
end


function onEquipped()

end


script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)


connection = sword.Touched:connect(blow)
Report Abuse
pwnedu46 is not online. pwnedu46
Joined: 23 May 2009
Total Posts: 7534
11 Nov 2011 07:21 PM
"game:GetService("Chat"):Chat(game.Workspace.Part,"Hello!",Enum.ChatColor.Red)"

I'm 99% sure that's locked.
Report Abuse
hung999 is not online. hung999
Joined: 19 Sep 2008
Total Posts: 819
11 Nov 2011 07:33 PM
soooo , what now ?
Report Abuse
hung999 is not online. hung999
Joined: 19 Sep 2008
Total Posts: 819
11 Nov 2011 08:10 PM
bump
Report Abuse
RoboTestGear is not online. RoboTestGear
Joined: 28 Dec 2009
Total Posts: 3063
12 Nov 2011 07:32 PM
@PWned, it's not.
Report Abuse
hung999 is not online. hung999
Joined: 19 Sep 2008
Total Posts: 819
12 Nov 2011 07:41 PM
I've tried it doesnt work
Report Abuse
Toukan is not online. Toukan
Joined: 24 Jan 2009
Total Posts: 5
18 Dec 2011 09:01 AM
Hello, i'm using this alt because i was banned for 7 days, anyway i got only 1 day left. What i did was just a loop.

Exemple:

myhp=script.Parent.Humanoid.Health

function Damaged(dmg) --dmg is the damages that were caused on 0.5 seconds.

end

while true do
wait(0.5) --Check if i got damaged 2 times per seconds, that prevents from Spam.
if script.Parent.Humanoid.Health[]myhp then --The health is lower than last time we checked (Replace [] by the Lower sign).
Damaged(myhp-script.Parent.Humanoid.Health)
end
myhp=script.Parent.Humanoid.Health
end



-Benjamint's Alt: Toukan
Report Abuse
hung999 is not online. hung999
Joined: 19 Sep 2008
Total Posts: 819
18 Dec 2011 12:31 PM
That made no sense to me :S
Report Abuse
RoboTestGear is not online. RoboTestGear
Joined: 28 Dec 2009
Total Posts: 3063
18 Dec 2011 10:25 PM
game:GetService("Chat"):Chat(game.Workspace.Part,"Hello!",Enum.ChatColor.Red)

works fine. NARBS
Report Abuse
Scriptishish is not online. Scriptishish
Joined: 16 Oct 2007
Total Posts: 1231
18 Dec 2011 10:27 PM
What they're trying very badly to say is:

When you damage, take said damage and hitPlayer's and:
game:GetService("Chat",hitPlayer.Head,damage,Enum.ChatColor.Red)

What this does is offer a 'chat' from the hurt Player's head that 'says' damage.
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