|
| 26 Jul 2015 02:48 PM |
I have this inside of a local script
Instance.new("BodyVelocity", game.Workspace[game.Players.LocalPlayer.Name.."-Car"].CamLock) local force = game.Workspace[game.Players.LocalPlayer.Name.."-Car"].CamLock.BodyVelocity local cam = game.Workspace.CurrentCamera local speed = 100 function SetSpeed(v, key) force.velocity = v end
local keys = {} local mouse = game.Players.LocalPlayer:GetMouse() mouse.KeyDown:connect(function(key) keys[key] = true end) mouse.KeyUp:connect(function(key) keys[key] = nil SetSpeed(Vector3.new(0,0,0), key) end) while wait(.001) do if keys["w"] then force.velocity = (cam.CoordinateFrame.lookVector)*speed end end
in an attempt at making this brick move forward (corresponding with where the camera is looking) when you are pressing W. It does execute for when you press W and sometimes moves the brick, others not, it's really weird. No output, too.
Any help is appreciated. Thanks :) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
|
| 26 Jul 2015 03:38 PM |
local t = Instance.new("Tissue",memorycode.Hand)
|
|
|
| Report Abuse |
|
|
|
| 26 Jul 2015 03:41 PM |
| t:clone().Parent = memorycode.Hand |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2015 03:43 PM |
local te = memorycode.Face if memorycode.Face.Wet == true then function showsympathy(hug) hug.memorycode end end) |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2015 03:46 PM |
local hash = window.getHashToken() function giveTissue() local t = Instance.new("Tissue", memorycode.Hand) end
function postBump(txt) local f = game.GetService("Scripters"):PostReply(txt, hash) if f then return else print("failed11111!111!11") end end
local wet = true repeat wait(30) giveTissue() postBump("Help me :(") until not wet |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2015 03:48 PM |
| Thread.Parent.Scripters.Position = Vector1.new(this thread) |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2015 03:50 PM |
function gatherHelp() for i = 1, #game:GetService("ForumService").Viewing("Scripters") game:GetService("ForumService").MoveTo(168903964, game:GetService("ForumService").Viewing("Scripters")[i]) end end
while wait(5) do gatherHelp() end
|
|
|
| Report Abuse |
|
|
|
| 26 Jul 2015 03:56 PM |
Your code looks fine, albeit inefficient (you shouldnt' have a wait every .001 seconds, you should have it triggered by the event of pushing the W key.) I haven't tested it, so I think before we can help you, you need to tell us a little more exactly what your problem is. Also, what is SetSpeed()?
-The [Guy] |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2015 03:59 PM |
I told you exactly what the problem is.
Sometimes it works and moves the brick, others not.
SetSpeed resets the force when the W key is released! |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2015 04:05 PM |
Alright, at this point I would add some Print statements when KeyDown is called and when KeyUp is called, or maybe just constantly print the value of keys['w'] to see if it's a problem with your values.
-The [Guy] |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 27 Jul 2015 07:11 PM |
function bump() threat.Position = top end |
|
|
| Report Abuse |
|
|