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 Need help with some kind of Mouse.Lookvector thing?

Previous Thread :: Next Thread 
Nikkulai is online. Nikkulai
Joined: 01 Jun 2014
Total Posts: 946
27 Feb 2017 07:47 PM
i am making a script and i have this:
yy = Instance.new("BodyVelocity")
yy.maxForce = Vector3.new(math.huge, math.huge, math.huge)
yy.velocity = Player.Character.Torso.CFrame.lookVector*100
yy.Parent = xx

But how would i make it go where the mouse is pointing? Please help. Thanks!


game: https://www.roblox.com/games/605940670/Bloxtrops-Adventure-WIP-V-0-1
Report Abuse
PlaceRebuilder is not online. PlaceRebuilder
Joined: 29 Apr 2008
Total Posts: 1056
27 Feb 2017 07:50 PM
1. Use better names for ur variables xx = brick yy = bv for example 2. Use mouse hit cframe local player = game.Players.LocalPlayer local mouse = player:GetMouse() local pos = mouse.Hit.p --Hit is a CFrame, # ## the position of that cframe local direction = (pos - xx.Position).unit yy.Velocity = direction * 10
Report Abuse
PlaceRebuilder is not online. PlaceRebuilder
Joined: 29 Apr 2008
Total Posts: 1056
27 Feb 2017 07:55 PM
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local pos = mouse.Hit.p
local direction = (pos - xx.Position).unit
yy.Velocity = direction * 10

Cleared it from roblox filtering.
Report Abuse
Nikkulai is online. Nikkulai
Joined: 01 Jun 2014
Total Posts: 946
27 Feb 2017 08:53 PM
Alright, Thanks Bro


game: https://www.roblox.com/games/605940670/Bloxtrops-Adventure-WIP-V-0-1
Report Abuse
ZyroKai is not online. ZyroKai
Joined: 26 Nov 2015
Total Posts: 136
27 Feb 2017 09:20 PM
I have a problem i have a character customization gui that changes shirts pants packages and faces, and it works in studio but not in game pls help
Report Abuse
Nikkulai is online. Nikkulai
Joined: 01 Jun 2014
Total Posts: 946
27 Feb 2017 09:57 PM
If the scripts are Normal scripts but use LocalPlayer then it wont work in game. Only localscripts work with that.


game: https://www.roblox.com/games/605940670/Bloxtrops-Adventure-WIP-V-0-1
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