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
 

Bug, occurs only during online mode?

Previous Thread :: Next Thread 
Raildex is not online. 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 is not online. 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 is not online. 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 is not online. 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
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