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: Buy Vehicle GUI working! Produced another problem.

Previous Thread :: Next Thread 
CjInc is not online. CjInc
Joined: 19 Aug 2011
Total Posts: 27
09 Jun 2015 11:33 AM
So, the GUI is now working, and when I you purchase the vehicle, it deducts 5000 from "Money," but 5000 is instantly given back, and the vehicle is stuck in the air.
Report Abuse
buildersteven4 is not online. buildersteven4
Joined: 08 May 2009
Total Posts: 1325
09 Jun 2015 11:39 AM
script?

Also the car is probably anchored.
Report Abuse
CjInc is not online. CjInc
Joined: 19 Aug 2011
Total Posts: 27
09 Jun 2015 11:40 AM
Well, yes, script. The GUI always worked lel. Yes, it is anchored, but all my cars are, but they still drive?
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
09 Jun 2015 11:42 AM
This kid...
Report Abuse
buildersteven4 is not online. buildersteven4
Joined: 08 May 2009
Total Posts: 1325
09 Jun 2015 11:42 AM
Weird cars you have then. but don't expect them to fall if they are anchored.

Also I was asking for the script. can't really help you any further without something to look at.
Report Abuse
CjInc is not online. CjInc
Joined: 19 Aug 2011
Total Posts: 27
09 Jun 2015 11:43 AM
At least I don't get 6,932 lines of errors ;)
Report Abuse
CjInc is not online. CjInc
Joined: 19 Aug 2011
Total Posts: 27
09 Jun 2015 11:44 AM
Oh! The script, yes. Here:

local model = game.Lighting:WaitForChild("Omicron")
local player = game.Players.LocalPlayer
local character =player.Character or player.CharacterAdded:wait()
local Currency = player:WaitForChild("leaderstats"):WaitForChild("Money")
local Price = 5000

function onClicked()
if Currency.Value >= Price then
Currency.Value = Currency.Value - Price
local a = model:Clone()
a.Parent = game.Workspace
a:MoveTo(character.Torso.Position + Vector3.new(0,0,8))
a:MakeJoints()
end
end
script.Parent.MouseButton1Click:connect(onClicked)
Report Abuse
buildersteven4 is not online. buildersteven4
Joined: 08 May 2009
Total Posts: 1325
09 Jun 2015 11:45 AM
is this a local script?
is filtering enabled?
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
09 Jun 2015 11:46 AM
It was a joke lol
Report Abuse
CjInc is not online. CjInc
Joined: 19 Aug 2011
Total Posts: 27
09 Jun 2015 11:47 AM
Local script, yes. No clue if filtering is enabled..?
Report Abuse
buildersteven4 is not online. buildersteven4
Joined: 08 May 2009
Total Posts: 1325
09 Jun 2015 11:49 AM
It's an attribute of the workspace. It's probably disabled if you don't know about it.
Report Abuse
buildersteven4 is not online. buildersteven4
Joined: 08 May 2009
Total Posts: 1325
09 Jun 2015 11:49 AM
http://wiki.roblox.com/index.php?title=FilteringEnabled
Report Abuse
CjInc is not online. CjInc
Joined: 19 Aug 2011
Total Posts: 27
09 Jun 2015 11:50 AM
Nope! It's enabled.
Report Abuse
buildersteven4 is not online. buildersteven4
Joined: 08 May 2009
Total Posts: 1325
09 Jun 2015 11:55 AM
Ah. that explains it. well small explanation:
you change the variable locally. that change is sent to the ROBLOX server. because filtering is enabled the ROBLOX server denies that change and puts it back to the old variable.

two ways to fix this:
- the sloppy and easy way: disable filtering
- the correct but harder way: implement a good server-client model with RemoteFunctions and RemoteEvents

some more info about that:
http://wiki.roblox.com/index.php?title=FilteringEnabled_with_the_Client-Server_Model
http://wiki.roblox.com/index.php?title=RemoteFunction_and_RemoteEvent_Tutorial
Report Abuse
CjInc is not online. CjInc
Joined: 19 Aug 2011
Total Posts: 27
09 Jun 2015 12:01 PM
I think I'll do the script, instead of disabling filtering. I disabled it, and the car came down, but it wont work at all XD
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