Raildex
|
  |
| Joined: 06 Dec 2009 |
| Total Posts: 934 |
|
|
| 27 Jan 2016 08:23 PM |
I'm getting a bug when I play my game that happens only on online and not in studio test mode. When the vehicle is spawned and positioned, in test mode you can drive right off with it, however in online play mode it anchors the vehicle to the place that it was moved to. Any idea whats happening here?
print("car Holder start") local car1 = game:GetService("ReplicatedStorage")["Car"]
local car2 = game:GetService("ReplicatedStorage")["Van"]
local car3 = game:GetService("ReplicatedStorage")["Off-Roader"]
local car4 = game:GetService("ReplicatedStorage")["Motorcycle"]
local carN = script.Parent.Parent:waitForChild("carValue") local carV local backup
cooldown = false
function Regen(player) print("clicked build") if(carN.Value == 1) then backup = car1:clone() print("set to Sedan") end if(carN.Value == 2) then backup = car2:clone() print("set to Van") end if(carN.Value == 3) then backup = car3:clone() print("set to Jeep") end if(carN.Value == 4) then backup = car4:clone() print("set to MotorCycle") end if(cooldown == false) then --------ACCESS THE USER STATS------------ local cash = game.Players.LocalPlayer.leaderstats.Cash if cash.Value > (script.Parent.Parent.CostV.Value-1) then print("has Money") cash.Value = cash.Value - script.Parent.Parent.CostV.Value ----------------------------------------- print("bought and building") carV = backup:clone() carV.Parent = game.Workspace carV:makeJoints() carV:SetPrimaryPartCFrame (script.objectValue.Value.CFrame+Vector3.new(0,5,0)) carV:SetPrimaryPartCFrame (carV.PrimaryPart.CFrame * CFrame.Angles(0,math.rad(180), 0)) print(carV.PrimaryPart) print("set to location") local c = carV.Primary:getChildren() for i = 1, #c do c.BrickColor = script.Parent.Parent.carPrimaryColor.Value end cooldown = true script.Parent.Text = "On Cooldown" wait(12) cooldown = false script.Parent.Text = "Build" end end end print("car Holder end") script.Parent.MouseButton1Down:connect(Regen) |
|
|
| Report Abuse |
|
|
Raildex
|
  |
| Joined: 06 Dec 2009 |
| Total Posts: 934 |
|
|
| 27 Jan 2016 11:22 PM |
Bump^
Im really stuck on how to fix this, does anyone have any Ideas? |
|
|
| Report Abuse |
|
|
mycheeze
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 6748 |
|
|
| 27 Jan 2016 11:24 PM |
| ( ͡° w ͡°) did you check if all of the parts are unanchored/unwelded to anchored parts |
|
|
| Report Abuse |
|
|
Raildex
|
  |
| Joined: 06 Dec 2009 |
| Total Posts: 934 |
|
|
| 27 Jan 2016 11:39 PM |
I added 'unanchor(carV)', (attached function below), after the car is moved and it fixed the anchoring problem. However now parts of it are flying off. I dont believe it is joining together correctly function unanchor (m) for _,i in pairs (m:GetChildren()) do if i:IsA("BasePart") then i:MakeJoints() i.Anchored = false else unanchor(i) end end end
|
|
|
| Report Abuse |
|
|