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: FireBall

Previous Thread :: Next Thread 
masternick95363 is not online. masternick95363
Joined: 04 Feb 2012
Total Posts: 292
08 Dec 2014 06:17 PM
Okay im working on a fire ball it works fine I press r and it spawns in the middle of the map.thats the problem how would I make it so when you spawn the fireball it follows your mouse?im not sure how to do that is anyone willing to teach me?
Report Abuse
masternick95363 is not online. masternick95363
Joined: 04 Feb 2012
Total Posts: 292
08 Dec 2014 06:23 PM
BUMP
Report Abuse
smallshadow68 is not online. smallshadow68
Joined: 03 Feb 2013
Total Posts: 606
08 Dec 2014 06:25 PM
How would it follow your mouse?
Report Abuse
masternick95363 is not online. masternick95363
Joined: 04 Feb 2012
Total Posts: 292
08 Dec 2014 06:27 PM
correct,how would I make it so when it spawns it follows your mouse
Report Abuse
smallshadow68 is not online. smallshadow68
Joined: 03 Feb 2013
Total Posts: 606
08 Dec 2014 06:28 PM
I mean how exactly does it follow it? Does it move to wherever the mouse is (on a surface), does it float a specific distance away from the player but in the direction of the mouse, does it follow your mouse on your screen...?
Report Abuse
smallshadow68 is not online. smallshadow68
Joined: 03 Feb 2013
Total Posts: 606
08 Dec 2014 06:28 PM
Close your eyes and imagine your game: describe to me exactly what you want it to look like.
Report Abuse
masternick95363 is not online. masternick95363
Joined: 04 Feb 2012
Total Posts: 292
08 Dec 2014 06:31 PM
okay I spawn the fire ball it spwans and then it heads it goes the direction the mouse was pointed at no it dosent move to the mouse it goes to the direction the mouse was pointed at
Report Abuse
smallshadow68 is not online. smallshadow68
Joined: 03 Feb 2013
Total Posts: 606
08 Dec 2014 06:35 PM
Whatever game you're working on, it sounds fun!

What you wanna do is this:
==========================
1. Add a 'BodyVelocity' to the fireball. This makes it move.
2. Make the Velocity of it the mouse direction.
==========================

In this script, I'm making 'fireball' the fireball you just spawned.
I'm making 'character' the character of the player.
I'm also making 'mouse' the player's mouse (you used KeyDown on it):
==========================
local bv = Instance.new("BodyVelocity")
bv.Parent = fireball
bv.Name = "Velocity"
bv.velocity = (character.Torso.Position - mouse.Hit.p).unit*50
==========================
Remember the variables I used, and substitute your variables in:
fireball - the fireball
character - the player's character
mouse - the mouse
Report Abuse
masternick95363 is not online. masternick95363
Joined: 04 Feb 2012
Total Posts: 292
08 Dec 2014 06:39 PM
Player = script.Parent.Parent
mouse = Player:GetMouse()

function onKeyDown(key)
key = key:lower()
if key == "r" then
local brick = Instance.new("Part", game.Workspace)
brick.Name = "NewBrick"
brick.Size = Vector3.new(3,3,3)
brick.Shape = ("Ball")
Instance.new('Fire',brick)
brick.Transparency = 0.5
end
end

mouse.KeyDown:connect(onKeyDown)
Report Abuse
smallshadow68 is not online. smallshadow68
Joined: 03 Feb 2013
Total Posts: 606
08 Dec 2014 06:45 PM
Player = script.Parent.Parent
mouse = Player:GetMouse()

function onKeyDown(key)
key = key:lower()
if key == "r" then
local brick = Instance.new("Part", game.Workspace)
brick.Name = "NewBrick"
brick.Size = Vector3.new(3,3,3)
brick.Shape = ("Ball")
brick.CanCollide = false
brick.Position = Player.Character.Torso.Position + Player.Character.Torso.CFrame.lookVector*5
brick.TopSurface = "Smooth"
brick.BottomSurface = "Smooth"
Instance.new('Fire',brick)
brick.Transparency = 0.5
local bv = Instance.new("BodyVelocity")
bv.Parent = brick
bv.velocity = (mouse.Hit.p - Player.Character.Torso.Position).unit*50
end
end

mouse.KeyDown:connect(onKeyDown)
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