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: My tool completely breaks in-game

Previous Thread :: Next Thread 
SenjuNaruto is not online. SenjuNaruto
Joined: 16 Feb 2012
Total Posts: 368
08 Oct 2013 09:32 PM
tl;dr: This tool used to work (before the new animations update), but now it only works in studio mode (the characters arm doesn't even go up when equipped, but the tool still works) and in-game the tool just breaks completely. Any help? here is the script if you want it


Tool = script.Parent
local PlayerR = game.Players.LocalPlayer
Run = game:GetService("RunService")
function onActivated()
if PlayerR.Magic.Value - 40 > 0 then
PlayerR.Magic.Value = PlayerR.Magic.Value - 40
script.Disabled = true
Player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
Tool.Handle.Fire.Enabled = true
Tool.Handle.Transparency = 0.3
Player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
for Rasengan = 1,10 do
Tool.Handle.Mesh.Scale = Tool.Handle.Mesh.Scale +Vector3.new (0.05, 0.05, 0.05)
Tool.Handle.Mesh.Scale = Tool.Handle.Mesh.Scale -Vector3.new (0.05, 0.05, 0.05)
Tool.Handle.Mesh.Scale = Tool.Handle.Mesh.Scale +Vector3.new (0.03, 0.03, 0.03)
wait()
end
z = Instance.new("NumberValue")
z.Name = "What"
z.Parent = Player.Character
z.Value = Player.Character.Humanoid.WalkSpeed
local color = "Green"
game:GetService("Chat"):Chat(Player.Character.Head, "Sage Art: Rasengan!", color)
Player.Character.Humanoid.WalkSpeed = 60
Tool.Handle.Rasengan.Disabled = false
for RasenganExists = 1,100 do
if Tool.Handle.Rasengan.Disabled == false then
wait (0.01)
end
end
Player.Character.Humanoid.WalkSpeed = z.Value
Tool.Handle.Rasengan.Disabled = true
Tool.Handle.Transparency = 0.7
Tool.Handle.Fire.Enabled = false
for Rasengan = 1,10 do
Tool.Handle.Mesh.Scale = Tool.Handle.Mesh.Scale -Vector3.new (0.03, 0.03, 0.03)
wait()
end
wait()
script.Disabled = false
end
end
script.Parent.Activated:connect(onActivated)
Report Abuse
thane1326 is not online. thane1326
Joined: 08 Apr 2009
Total Posts: 867
08 Oct 2013 09:36 PM
What does the output say when you run the script?
Report Abuse
SenjuNaruto is not online. SenjuNaruto
Joined: 16 Feb 2012
Total Posts: 368
08 Oct 2013 09:39 PM
Absolutely nothing. There is nothing else in the tool.
Report Abuse
SenjuNaruto is not online. SenjuNaruto
Joined: 16 Feb 2012
Total Posts: 368
08 Oct 2013 09:41 PM
Actually I lied; there is another script. Here it is:
tl;dr : Makes a blue part grow around the part that was hit and makes the hit player lose health and sit.

function onTouched (Part)
if Part.Parent:FindFirstChild("Humanoid") ~=nil then
script.Disabled = true
x = Instance.new("Part")
x.Parent = Part.Parent
x.Shape = "Ball"
x.Size = Vector3.new (2,2,2)
x.BrickColor = BrickColor.new("Pastel light blue")
x.Transparency = 0.3
x.CanCollide = false
x.Anchored = true
x.BottomSurface = "Smooth"
x.TopSurface = "Smooth"
y = Instance.new("SpecialMesh")
y.Parent = x
y.MeshType = "Sphere"
y.Scale = Vector3.new (0, 0, 0)
for i = 1,40 do
y.Scale = y.Scale +Vector3.new (0.1, 0.1, 0.1)
x.CFrame = Part.Parent.Torso.CFrame
Part.Parent.Humanoid.Health = Part.Parent.Humanoid.Health - 1
wait()
end
if x ~= nil then
x:remove()
end
wait()
Part.Parent.Humanoid.Sit = true
end
end

script.Parent.Touched:connect(onTouched)
Report Abuse
thane1326 is not online. thane1326
Joined: 08 Apr 2009
Total Posts: 867
08 Oct 2013 09:42 PM
Could it be line; script.Disabled = true
Report Abuse
thane1326 is not online. thane1326
Joined: 08 Apr 2009
Total Posts: 867
08 Oct 2013 09:45 PM
You have a few lines in the both scripts that say script.Disabled = true, these will disable the script, if you want to make it disable the tool then use Tool.Disabled = true
Report Abuse
SenjuNaruto is not online. SenjuNaruto
Joined: 16 Feb 2012
Total Posts: 368
09 Oct 2013 04:00 PM
Tool.Disabled is not a valid line nor would it help if I fixed that to work. Any other solutions?
Report Abuse
SenjuNaruto is not online. SenjuNaruto
Joined: 16 Feb 2012
Total Posts: 368
09 Oct 2013 04:19 PM
bump
Report Abuse
blocco is not online. blocco
Joined: 14 Aug 2008
Total Posts: 29474
09 Oct 2013 04:23 PM
Why are you disabling your code from the code?
Report Abuse
SenjuNaruto is not online. SenjuNaruto
Joined: 16 Feb 2012
Total Posts: 368
09 Oct 2013 04:40 PM
That helps so people can not abuse the tool. Those lines of code worked before.
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
09 Oct 2013 04:43 PM
But you could stop it from being used without disabling it?
Report Abuse
SenjuNaruto is not online. SenjuNaruto
Joined: 16 Feb 2012
Total Posts: 368
09 Oct 2013 04:47 PM
How? And I don't think thats the problem; I get that alot from the scripters helpers area, but I assure you, all of my other scripts run with that line and function just fine.
Report Abuse
blocco is not online. blocco
Joined: 14 Aug 2008
Total Posts: 29474
09 Oct 2013 05:23 PM
Disabling your code will not and SHOULD NOT allow it to continue running. "It worked before" is not a valid reason to assume it works now.
Report Abuse
SenjuNaruto is not online. SenjuNaruto
Joined: 16 Feb 2012
Total Posts: 368
09 Oct 2013 05:47 PM
It still works. When I remove those lines, you can spam the tool and I don't think that would help game balancing. The code runs before it is disabled.
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