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 » Scripting Helpers
Home Search
 

Re: Im having some problems in this script

Previous Thread :: Next Thread 
DragonOfWar900 is not online. DragonOfWar900
Joined: 11 May 2011
Total Posts: 1508
07 Mar 2014 05:43 PM
local cam = game.Workspace.CurrentCamera
local DZ = script.Parent.ScreenGui.DraxorianZ.Value
local MR = script.Parent.ScreenGui.MoveRight.Value
local ML = script.Parent.ScreenGui.MoveLeft.Value
local StarterPos = Vector3.new(12.8, 29, -4.6)
local PA = Vector3.new(0.1,0,0)
local Targ = nil

if DZ == true then--1)
Targ = game.Workspace.Draxxarian.Targ.Position
else
Targ = game.Workspace.Bloxinator.Targ.Position
end

cam.CameraType = "Scriptable"
cam.CameraSubject = game.Workspace
cam.CoordinateFrame = CFrame.new(StarterPos,Targ)

if MR == true then--1)
for i = 1, 202 do
cam.CoordinateFrame = CFrame.new(PA, Targ)
wait (0.001)
end
end
if ML == true then--1)
for i = 1, 202 do
cam.CoordinateFrame = cam.CoordinateFrame*CFrame.new(PA, Targ):inverse()
wait (0.001)
end
end

1) Theres a problem here. Everytime that i put those values to true, nothing happens, but only if i update the script, so how i update atleast these chunks so everytime the value is set to true, it does something?
Report Abuse
getkoed is not online. getkoed
Joined: 18 Feb 2010
Total Posts: 2298
07 Mar 2014 05:44 PM
Things only fire once, so if stuff is changing after the script has run, it won't really do anything. In this case you should use the Changed event.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
07 Mar 2014 05:47 PM
Never EVER index the value as a variable tho..
Only index the object,then check the value..

Obj = thing.Value
print (Obj)

script.Parent.thing.Value = 1
print (Obj)
print (script.Parent.thing.Value)
print(Obj)
Output
0
0
1
0
...

So use thing changed event on thing,and check things value
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
07 Mar 2014 05:49 PM
Example:

Obj = script.Parent.Val
Obj.Changed:connect(function()
if Obj.Value == valuehere then
print "yep,that's it alright.."
--dosomething
else
print("wait,that's not the value,ignore this..")
end
end)
Report Abuse
DragonOfWar900 is not online. DragonOfWar900
Joined: 11 May 2011
Total Posts: 1508
07 Mar 2014 05:57 PM
so i made this:
DZ.Value.Changed:connect(function () --line 7
if DZ.Value == true then
Targ = game.Workspace.Draxxarian.Targ.Position
else
Targ = game.Workspace.Bloxinator.Targ.Position
end
end)
now im getting an error
Players.Player1.PlayerGui.LocalScript:7: attempt to index field 'Value' (a boolean value)
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
07 Mar 2014 06:04 PM
DZ.Changed instead of DZ.Value.Changed
Report Abuse
DragonOfWar900 is not online. DragonOfWar900
Joined: 11 May 2011
Total Posts: 1508
07 Mar 2014 06:18 PM
OK now everything is working fine now!!!!!!!!!!!!!!!!! atleast at solo (dam roblox, if you show me on online mode that its not working, ill punch you in da face)
Report Abuse
DragonOfWar900 is not online. DragonOfWar900
Joined: 11 May 2011
Total Posts: 1508
07 Mar 2014 06:29 PM
Check my profile to see what am i doing :)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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