|
| 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
|
  |
| 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 |
|
|
| |
|
Egzekiel
|
  |
| Joined: 10 Jan 2011 |
| Total Posts: 1079 |
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 19 Jun 2015 05:45 AM |
| ignore event part it might make ur script buggy. |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 19 Jun 2015 06:01 AM |
| i already script one put in localscript its working e.e |
|
|
| Report Abuse |
|
|
| |
|
|
| 19 Jun 2015 06:21 AM |
| Your script broke in game ;-; |
|
|
| Report Abuse |
|
|
| |
|
Egzekiel
|
  |
| Joined: 10 Jan 2011 |
| Total Posts: 1079 |
|
| |
|
| |
|
duvie
|
  |
| Joined: 02 Mar 2013 |
| Total Posts: 8 |
|
|
| 04 Feb 2016 07:45 PM |
how do i leanr to script ;-;
|
|
|
| Report Abuse |
|
|