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: I got problem with fireball scripting.

Previous Thread :: Next Thread 
RebornProductions is not online. RebornProductions
Joined: 07 May 2015
Total Posts: 8
19 Jun 2015 04:39 AM
I'm still a begginer and i'm trying to script fireball. But it does no demage. I use Localscript and demage script in it. http://gyazo.com/1797ccf34aa246d8b3f9781fbb7f44c2 http://gyazo.com/254814aa709d8e59236c8b32dccf5449
Report Abuse
Egzekiel is not online. Egzekiel
Joined: 10 Jan 2011
Total Posts: 1079
19 Jun 2015 04:42 AM
Making a damage script like the Roblox's rocket launcher really is not efficient

You just need to add a Projectile.Touched event.
Report Abuse
RebornProductions is not online. RebornProductions
Joined: 07 May 2015
Total Posts: 8
19 Jun 2015 04:56 AM
Oh I see. Thank you.
Report Abuse
Egzekiel is not online. Egzekiel
Joined: 10 Jan 2011
Total Posts: 1079
19 Jun 2015 04:56 AM
No Problem ;)
Report Abuse
RebornProductions is not online. RebornProductions
Joined: 07 May 2015
Total Posts: 8
19 Jun 2015 05:02 AM
Ah, can I have example of touched thing. Becouse i'm still begginer can't script much :I
Report Abuse
Wreckerbuster67 is not online. Wreckerbuster67
Joined: 29 Jul 2012
Total Posts: 1144
19 Jun 2015 05:17 AM
.Touched is literally the first event I learned of. Anyways, it basically goes like:

partObject.Touched:connect(function(part) -- fires an event when the object is touched; "part" argument is the part that touched it.
Report Abuse
CaptainSource is not online. CaptainSource
Joined: 08 Jun 2013
Total Posts: 848
19 Jun 2015 05:28 AM
omg no no no no no no no no !!


coroutine.resume(coroutine.create(function()
for i=1,13,1 do
fireball.Mesh.Scale = blablabla
wait();
end;
end);

you want to size up when its moving right. use this. instead of for i=1,13,1 because in ur script it will scale up first then start to moving also dont forget add local

local firaball;

and also please

Instance.new(ClassName,Parent)

not

classname = Instance.new("ClassName")
classname.Parent = Parent.
Report Abuse
CaptainSource is not online. CaptainSource
Joined: 08 Jun 2013
Total Posts: 848
19 Jun 2015 05:29 AM
whoops i typed wrong here

coroutine.resume(coroutine.create(function()
for i=1,13,1 do

wait(0);
end;
end));
Report Abuse
Wreckerbuster67 is not online. Wreckerbuster67
Joined: 29 Jul 2012
Total Posts: 1144
19 Jun 2015 05:39 AM
Since you're making him used advanced stuff instantly instead of putting him on the learning curve, WHO THE HELL DOES wait(0) INSTEAD OF wait()
Report Abuse
Egzekiel is not online. Egzekiel
Joined: 10 Jan 2011
Total Posts: 1079
19 Jun 2015 05:41 AM
And why would some do this? for i=1,10,1 xD that's useless to put the third argument as it is 1 if you put nothing
Report Abuse
CaptainSource is not online. CaptainSource
Joined: 08 Jun 2013
Total Posts: 848
19 Jun 2015 05:44 AM
derp i like putting 1 and wait(0) was only for example.

local player = game:FindService("Players").LocalPlayer;
player.Character:WaitForChild("Humanoid");

local debounce = false;
local event;

game:GetService("UserInputService").InputBegan:connect(function(v,b)
if v.KeyCode == Enum.KeyCode.F then

local fireballpart = Instance.new("Part", game:FindService("Workspace"));
fireballpart.Shape = Enum.PartType.Ball;
fireballpart.FormFactor = Enum.FormFactor.Custom;
fireballpart.CFrame = player.Character:FindFirstChild("Torso").CFrame *CFrame.new(0,0,-5); -- "-5" is distance between you and part.
fireballpart.Anchored = false;
fireballpart.CanCollide = true;
fireballpart.Locked = true;
fireballpart.Size = Vector3.new(3,3,3);
fireballpart.BrickColor = BrickColor.new("Bright red");
fireballpart.BottomSurface = Enum.SurfaceType.Smooth;
fireballpart.TopSurface = Enum.SurfaceType.Smooth;

local bodyvelocity = Instance.new("BodyVelocity", fireballpart);
bodyvelocity.maxForce = Vector3.new(math.huge,math.huge,math.huge);
bodyvelocity.velocity = player.Character:FindFirstChild("Torso").CFrame.lookVector*100;

coroutine.resume(coroutine.create(function()
for i=1,13,1 do
if fireballpart then
fireballpart.Size = Vector3.new(i,i,i);
end;
wait();
end;
end));

if event then
event:disconnect(); -- idk need this or not but i like disconnecting events.
end;

event = fireballpart.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and debounce == false then
debounce = true;
hit.Parent:FindFirstChild("Humanoid"):TakeDamage(25);
fireballpart:remove();
wait();
debounce = false;
end;
end);

game:GetService("Debris"):AddItem(fireballpart,1); -- "1" is time it will remove like after 1 sec it will remove itself.
end;
end);
Report Abuse
CaptainSource is not online. CaptainSource
Joined: 08 Jun 2013
Total Posts: 848
19 Jun 2015 05:45 AM
ignore event part it might make ur script buggy.
Report Abuse
Egzekiel is not online. Egzekiel
Joined: 10 Jan 2011
Total Posts: 1079
19 Jun 2015 05:47 AM
Why you add ; everywhere that's useless ._.

Also, you did a mistake here:

event = fireballpart.Touched:connect(function(hit)

That's a function, if you want to make a named function, do this instead

function Touch(hit)
--script
end

part.Touched:connect(Touch)

Otherwise, remove the event =
Report Abuse
CaptainSource is not online. CaptainSource
Joined: 08 Jun 2013
Total Posts: 848
19 Jun 2015 05:50 AM
no thats true function i added event variable to break last part touched event but as i noticed when u create new fireball it will ignore last one and lets if you create 2 part the first part wont damage you so it will be buggy.
Report Abuse
RebornProductions is not online. RebornProductions
Joined: 07 May 2015
Total Posts: 8
19 Jun 2015 05:55 AM
Why don't you both create scripts and test it out who'se will work .3. I would take working one
.3.
Report Abuse
CaptainSource is not online. CaptainSource
Joined: 08 Jun 2013
Total Posts: 848
19 Jun 2015 06:01 AM
i already script one put in localscript its working e.e
Report Abuse
RebornProductions is not online. RebornProductions
Joined: 07 May 2015
Total Posts: 8
19 Jun 2015 06:11 AM
kk thx
Report Abuse
RebornProductions is not online. RebornProductions
Joined: 07 May 2015
Total Posts: 8
19 Jun 2015 06:21 AM
Your script broke in game ;-;
Report Abuse
CaptainSource is not online. CaptainSource
Joined: 08 Jun 2013
Total Posts: 848
19 Jun 2015 06:29 AM
noooo why !! ;-;
Report Abuse
Egzekiel is not online. Egzekiel
Joined: 10 Jan 2011
Total Posts: 1079
19 Jun 2015 06:37 AM
Post error log.
Report Abuse
CaptainSource is not online. CaptainSource
Joined: 08 Jun 2013
Total Posts: 848
19 Jun 2015 06:42 AM
prees f9 and tell error
Report Abuse
duvie is not online. duvie
Joined: 02 Mar 2013
Total Posts: 8
04 Feb 2016 07:45 PM
how do i leanr to script ;-;

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