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 » Scripters
Home Search
 

Re: Linked sword...

Previous Thread :: Next Thread 
AkatUme is not online. AkatUme
Joined: 04 Mar 2012
Total Posts: 1598
31 Aug 2015 09:13 PM
HELLO! I don't know if you are familiar with the linked sword, but there is a function in the main script, and it is the function that does the damage:

function blow(hit)
if (hit.Parent == nil) then return end -- happens when bullet hits sword
local humanoid = hit.Parent:findFirstChild("Humanoid")
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character


if humanoid~=nil and humanoid ~= hum and hum ~= nil and game.Players:GetPlayerFromCharacter(humanoid.Parent).TeamColor ~= vPlayer.TeamColor then ----THIS PART ISNT WORKING
print(vPlayer.TeamColor) -----AND NOR IS THIS PART, IT WONT PRINT ANYTHING, NOT EVEN A STRING




local right_arm = vCharacter:FindFirstChild("Right Arm")
if (right_arm ~= nil) then
local joint = right_arm:FindFirstChild("RightGrip")
if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
tagHumanoid(humanoid, vPlayer)
humanoid:TakeDamage(damage)
wait(1)
untagHumanoid(humanoid)
end
end
end
end

Do you know why it won't print?

~AkatUme~(RedPlum)~ Scripter, Builder, Trader~
Report Abuse
AkatUme is not online. AkatUme
Joined: 04 Mar 2012
Total Posts: 1598
31 Aug 2015 09:14 PM
!! I forgot to say thank you!


~AkatUme~(RedPlum)~ Scripter, Builder, Trader~
Report Abuse
AkatUme is not online. AkatUme
Joined: 04 Mar 2012
Total Posts: 1598
31 Aug 2015 09:24 PM
Wtf... Actually NOTHING will print, no matter where it is in the script..


~AkatUme~(RedPlum)~ Scripter, Builder, Trader~
Report Abuse
TheZankonator is not online. TheZankonator
Joined: 27 Jun 2009
Total Posts: 1888
31 Aug 2015 09:42 PM
I don't actually know if this is the problem, but I know that sometimes I'll run into object errors. Try doing print(tostring(vPlayer.TeamColor)) or something like that.
Report Abuse
AkatUme is not online. AkatUme
Joined: 04 Mar 2012
Total Posts: 1598
01 Sep 2015 04:03 PM
Thank you so much for the response!

Actually, I figured out the problem. Thanks though anyway!


~AkatUme~(RedPlum)~ Scripter, Builder, Trader~
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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