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: Roblox U Help sword wont swing

Previous Thread :: Next Thread 
joeyluu999 is not online. joeyluu999
Joined: 18 Apr 2012
Total Posts: 5
02 Oct 2014 04:08 PM
Help when i test my game i try swinging it wont swing can you help

SWORD MAIN SCRIPT
--Made By Joeyluu999 RobloxU--
local sp = script.Parent
local Mspeed = 1.25
local handle = sp:WaitForChild("Handle")
local event = sp:WaitForChild("REvent")
local slashsound = handle:WaitForChild("SlashSound")
local thrustsound = handle:WaitForChild("OverheadSound")
local overheadsound = handle:WaitForChild("LungeSound")
local hithumanoids = {}
local damage = 25
local lastclick = 0
local slashtime = 1
local Cwindowing = .5
local combo = 0
handle.Touched:connect(function(hit)
if equipped and characters and humanoid and humanoid.Health > 0 and hit and not hit:isDescendantOf(characters) then
local targethumanoid = hit.Parent:FindFirstChild("Humanoid")
if targethumanoid and targethumanoid.Health > 0 and not hithumanoids[targethumanoid] then
hithumanoids[targethumanoid] = true
targethumanoid:TakeDamage(damage)
targethumanoid:TakeDamage(damage * combo)

end
end
end)
sp.Activated:connect(function()
local clickdelta = tick() - lastclick
if clickdelta < slashtime then
lastclick = tick()
hithumanoids = {}
if clickdelta > slashtime + Cwindowing then
combo = (combo + 1)%3
else
combo = 0
end
if player then
if combo == 0 then
event:FireClient(player, "RunAnimation","AnSlash2")
slashsound:Play()
elseif combo == 1 then
event:FireClient(player, "RunAnimation","AnThrust2")
thrustsound:Play()
elseif combo == 2 then
event:FireClient(player, "RunAnimation","AnOverhead2")
overheadsound:Play()
end
end
end

end)
sp.Equipped:connect(function()
equipped = true;
lastclick = tick()
characters = sp.Parent
player = game.Players:GetPlayerFromCharacter(characters)
humanoid = characters:FindFirstChild("Humanoid")
if humanoid then
humanoid.WalkSpeed = humanoid.WalkSpeed * Mspeed
else
charcater = nil
end


end)
sp.Unequipped:connect(function()
equipped = false;
if humanoid then
humanoid.WalkSpeed = humanoid.WalkSpeed / Mspeed
else
charcater = nil
humanoid = nil
end
end)

SWORD LOCAL SCRIPT
--Made By Joeyluu999 RobloxU--
local sp = script.Parent
local event = sp:WaitForChild("REvent")
event.OnClientEvent:connect(function(...)
local tuple = {...}
if tuple{1} == "RunAnimation" then
local anima = sp:FindFirstChild(tuple{2})
if anima and humanoid then
local loadanima = humanoid:LoadAnimation(anima)
if loadanima then
loadanima:Play()
if mouses then
mouses.Icon = "rbxasset://textures\\GunWaitCursor.png"
wait(1)
mouses.Icon = "rbxasset://textures\\GunCursor.png"
end
end
end
end
end)
sp.Equipped:connect(function(mouse)
local anima = sp:FindFirstChild("AnEquip5")
mouses = mouse
local character = sp.Parent
humanoid = character:FindFirstChild("Humanoid")
if humanoid then
local anima = sp:FindFirstChild("AnIdle5")
if anima and humanoid then
if LoadIdleAnima then
LoadIdleAnima:Stop()
end
LoadIdleAnima = humanoid:LoadAnimation(anima)
if LoadIdleAnima then
LoadIdleAnima:Play()
end
end
local anima = sp:FindFirstChild("AnEquip5")
local LoadIdleAnima = humanoid:LoadAnimation(anima)
if LoadIdleAnima then
LoadIdleAnima:Play()

end
end
if mouses then
mouses.Icon = "rbxasset://textures\\GunCursor.png"
end
end)

sp.Unequipped:connect(function()
if LoadIdleAnima then
LoadIdleAnima:Stop()
end
end)

also if you need anything else reply
Report Abuse
joeyluu999 is not online. joeyluu999
Joined: 18 Apr 2012
Total Posts: 5
03 Oct 2014 04:35 PM
anyone?
Report Abuse
joeyluu999 is not online. joeyluu999
Joined: 18 Apr 2012
Total Posts: 5
04 Oct 2014 12:32 PM
BUMP
Report Abuse
joeyluu999 is not online. joeyluu999
Joined: 18 Apr 2012
Total Posts: 5
12 Oct 2014 05:04 PM
plz someone reply
Report Abuse
joeyluu999 is not online. joeyluu999
Joined: 18 Apr 2012
Total Posts: 5
14 Oct 2014 08:26 PM
HELP
Report Abuse
FauxHawke is not online. FauxHawke
Joined: 08 Jun 2012
Total Posts: 2190
14 Oct 2014 09:07 PM
Suggestion:
Don't ask others to debug your broken code without giving a hint what sort of problem you are having. Posting a few hundred lines of code, saying "it doesn't work", will get you ignored. Posting a dozen lines of code, saying "after line 7 I was expecting to see (something), but (something else) happened instead" is much more likely to get you a reply.

Never trust atoms, they make up everything.™
Report Abuse
TrainingToTroll is not online. TrainingToTroll
Joined: 27 Oct 2012
Total Posts: 1757
14 Oct 2014 10:12 PM
Tip: Enable the script
Report Abuse
Joshua7851 is not online. Joshua7851
Joined: 18 Nov 2012
Total Posts: 210
14 Oct 2014 10:40 PM
im no expert but, try adding wait(2) after the animation plays.
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