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: works in studio, not in game?

Previous Thread :: Next Thread 
letris is not online. letris
Joined: 17 Dec 2012
Total Posts: 572
17 Jun 2017 06:26 PM
the only thing that isnt working in game is changing the rocks velocity, anyone know why? local mouse = game.Players.LocalPlayer:GetMouse() mouse.KeyDown:connect(function(key) if key == "a" then workspace.rock.Velocity = ###################### ###### ### == "d" then workspace.rock.Velocity = ####################### ###### ### == "w" then workspace.rock.Velocity = Vector3.new(0,100,50) wait(0.5) workspace.rock.Velocity = Vector3.new(0,-20,50) wait(0.5) workspace.rock.Velocity = Vector3.new(0,0,50) wait(1) end end)
Report Abuse
letris is not online. letris
Joined: 17 Dec 2012
Total Posts: 572
17 Jun 2017 06:27 PM
wow....

pastebin / Z C c T t f V D
Report Abuse
letris is not online. letris
Joined: 17 Dec 2012
Total Posts: 572
17 Jun 2017 06:38 PM
i just want to know why it wont change the velocity of the part when a key is pressed
Report Abuse
letris is not online. letris
Joined: 17 Dec 2012
Total Posts: 572
17 Jun 2017 07:22 PM
b1
Report Abuse
SuperOmar54 is not online. SuperOmar54
Joined: 12 Aug 2012
Total Posts: 415
17 Jun 2017 07:33 PM
Try using UserInputService instead

local uis = game:GetService("UserInputService")

uis.InputBegan:connect(function(input, gameprocessed)

if input.KeyCode == Enum.KeyCode.A then
--code
end
end)
Report Abuse
letris is not online. letris
Joined: 17 Dec 2012
Total Posts: 572
17 Jun 2017 07:45 PM
still doesnt work, it gets input from the keys, but it wont change the parts velocity
Report Abuse
SuperOmar54 is not online. SuperOmar54
Joined: 12 Aug 2012
Total Posts: 415
17 Jun 2017 07:48 PM
Try putting it in a server script not local.
Report Abuse
letris is not online. letris
Joined: 17 Dec 2012
Total Posts: 572
17 Jun 2017 07:53 PM
putting it in a serverscript makes nothing work, its the velocity that doesnt want to change, why is the velovity not changing?
Report Abuse
SuperOmar54 is not online. SuperOmar54
Joined: 12 Aug 2012
Total Posts: 415
17 Jun 2017 07:54 PM
Wait are you trying to make the rock move? If so, Velocity makes it act as a conveyor, but doesn't move it..
Report Abuse
letris is not online. letris
Joined: 17 Dec 2012
Total Posts: 572
17 Jun 2017 07:57 PM
https://www.youtube.com/watch?v=my9vm3tIJHU&feature=youtu.be

this is what its supposed to do. by changing the velocity it does whats shown in the viedo. but in game is does nothing
Report Abuse
veryveryveryhidden is online. veryveryveryhidden
Joined: 16 Dec 2012
Total Posts: 486
17 Jun 2017 08:06 PM
Velocity is not a constant force, you must constantly set the velocity.
Report Abuse
SuperOmar54 is not online. SuperOmar54
Joined: 12 Aug 2012
Total Posts: 415
17 Jun 2017 08:09 PM
Do you have FilteringEnabled on? If so, is this compatible with it?
Report Abuse
Dev_Cos is not online. Dev_Cos
Joined: 22 Oct 2016
Total Posts: 83
17 Jun 2017 08:28 PM
Is the script a "Script" or a "Local Script".
Report Abuse
letris is not online. letris
Joined: 17 Dec 2012
Total Posts: 572
17 Jun 2017 08:31 PM
It's in a local script and filtering enabled is off.
I'm guessing i would need to do something like this:

While true do
Part.velocity = Part.Velocity + Vector3.new (10,0,0)
Wait ()
end
Report Abuse
SuperOmar54 is not online. SuperOmar54
Joined: 12 Aug 2012
Total Posts: 415
17 Jun 2017 08:34 PM
Since it works in studio, then it has to be related to client/server. Where do you have the script in?
Report Abuse
veryveryveryhidden is online. veryveryveryhidden
Joined: 16 Dec 2012
Total Posts: 486
17 Jun 2017 08:34 PM
If that's the direction you're getting at. But the overall point of constantly setting the velocity is correct, yes.
Report Abuse
Dev_Cos is not online. Dev_Cos
Joined: 22 Oct 2016
Total Posts: 83
17 Jun 2017 08:39 PM
I've had this problem. I solved it by simply adding wait(1) at the beginning of the script. If it does not work, I really apologize for wasting your time. I'm not an expert but I just wanted to help.
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