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: Got a problem with my script

Previous Thread :: Next Thread 
Nicothefunky is not online. Nicothefunky
Joined: 10 Jul 2008
Total Posts: 204
19 Jan 2012 10:33 AM
Hello,
I made this script but I need some help...
I will explain first what it is/does..
Basicly i got 6 Boolaen Value's(standart on true) when a player joins and the first value is true it gives you camera1 (got 6 different camera's) and puts the boolvalue on false.. And when another player joins it looks at the first boolean value and sees it is false so it goes to the next one and see it is true and puts it on false and gives camera2, and so on...
What my problem is..
When i test it out locally i can see it puts the value on false.. And when i manually put the first one of false and then test it out i go on camera2.. So locally tested the system works
But when i test it with a friend on a server it doesn't work everyone goes on camera1...

this is my script:

v1 = game.Workspace.kar1--BoolValue 1
v2 = game.Workspace.kar2--BoolValue 2
v3 = game.Workspace.kar3--BoolValue 3
v4 = game.Workspace.kar4--BoolValue 4
v5 = game.Workspace.kar5--BoolValue 5
v5 = game.Workspace.kar6--BoolValue 6
--camera
if v1.Value==true then --when boolvalue1 is true it goes into here
game.Players.PlayerAdded:connect(function (newPlayer)
newPlayer.Changed:connect(function (property)
if (property == "Character") then
script.Camera1:Clone().Parent = newPlayer.Character--gives camera1
end
end)
end)
v1.Value = false--puts boolvalue1 on false
elseif v2.Value == true then--..
game.Players.PlayerAdded:connect(function (newPlayer)
newPlayer.Changed:connect(function (property)
if (property == "Character") then
script.Camera2:Clone().Parent = newPlayer.Character
end
end)
end)
v2.Value = false
elseif v3.Value == true then
game.Players.PlayerAdded:connect(function (newPlayer)
newPlayer.Changed:connect(function (property)
if (property == "Character") then
script.Camera3:Clone().Parent = newPlayer.Character
end
end)
end)
v3.Value = false
elseif v4.Value == true then
game.Players.PlayerAdded:connect(function (newPlayer)
newPlayer.Changed:connect(function (property)
if (property == "Character") then
script.Camera4:Clone().Parent = newPlayer.Character
end
end)
end)
v4.Value = false
elseif v5.Value == true then
game.Players.PlayerAdded:connect(function (newPlayer)
newPlayer.Changed:connect(function (property)
if (property == "Character") then
script.Camera5:Clone().Parent = newPlayer.Character
end
end)
end)
v5.Value = false
elseif v6.Value == true then
game.Players.PlayerAdded:connect(function (newPlayer)
newPlayer.Changed:connect(function (property)
if (property == "Character") then
script.Camera6:Clone().Parent = newPlayer.Character
end
end)
end)
v6.Value = false
end
Report Abuse
blueymaddog is not online. blueymaddog
Joined: 23 Sep 2009
Total Posts: 5459
19 Jan 2012 10:47 AM
>Start Server
>Start Player
>Start Player
>Start Player

check output.
Report Abuse
Nicothefunky is not online. Nicothefunky
Joined: 10 Jul 2008
Total Posts: 204
19 Jan 2012 11:19 AM
Blueymaddog, what's your point..? My script doesn't give any error, it just gives everyone that joined camera1, and normally first player that joined should poot boolvalue1 on false, so that the second player get camera2.. On solo play i can see that the putting on false works.. But i don't know if that works in server
Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
19 Jan 2012 11:54 AM
I know why it not work on a online server, it is because it you must use a LocalScript, the cameraes only exist on the client, and not on the server.
Report Abuse
Nicothefunky is not online. Nicothefunky
Joined: 10 Jul 2008
Total Posts: 204
19 Jan 2012 12:00 PM
the camera scripts are local scripts,
but the giving scirpt that i posted above is a usual script,
and i think it should be one..
Or should it also be a localscript?
Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
19 Jan 2012 12:04 PM
the main script must be a normal script
Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
19 Jan 2012 12:05 PM
but what is the camera scripts?
Report Abuse
Nicothefunky is not online. Nicothefunky
Joined: 10 Jul 2008
Total Posts: 204
19 Jan 2012 12:10 PM
This is camera1 script (insade giving script)

local cam = game.Workspace.CurrentCamera
cam.CameraSubject = game.Workspace.karrekes.kar1.VehicleSeat -- sets camera to this brick
Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
19 Jan 2012 12:12 PM
ok, I can see what I can do to help you
Report Abuse
Nicothefunky is not online. Nicothefunky
Joined: 10 Jul 2008
Total Posts: 204
19 Jan 2012 12:14 PM
Oke take your time :D

Thanks by the way :D
Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
19 Jan 2012 01:09 PM
Here is the new working script I have tested it.
it is a modified and shortened version of your original
it uses the same principle as your, but I have added an array with the BoolValues:

v = {
["kar"] = {
["kar1"] = game.Workspace.kar1,--BoolValue 1
["kar2"] = game.Workspace.kar2,--BoolValue 2
["kar3"] = game.Workspace.kar3,--BoolValue 3
["kar4"] = game.Workspace.kar4,--BoolValue 4
["kar5"] = game.Workspace.kar5,--BoolValue 5
["kar6"] = game.Workspace.kar6--BoolValue 6
},
["Players"] = {}
}
--camera
game.Players.PlayerAdded:connect(function (newPlayer)
for key,value in pairs(v.kar) do
newPlayer.Changed:connect(function (property)
if value.Value and not v.Players[newPlayer] then --when boolvalue# is true it goes into here
if (property == "Character") then
script["Camera"..key:match("%a+(%d+)")]:Clone().Parent = newPlayer.Character--gives camera#
value.Value = false
v.Players[newPlayer] = true
end
end
end)
end
end)
Report Abuse
Nicothefunky is not online. Nicothefunky
Joined: 10 Jul 2008
Total Posts: 204
19 Jan 2012 01:22 PM
Wow! Thanks gonna test it,
but this line:
script["Camera"..key:match("%a+(%d+)")]:Clone().Parent = newPlayer.Character--gives camera#

do i need to modifie the Camera with camera1 ,camera,2,.. for each camera or not?
Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
19 Jan 2012 01:25 PM
no, the command
key:match("%a+(%d+)")
fixing the number
Report Abuse
Nicothefunky is not online. Nicothefunky
Joined: 10 Jul 2008
Total Posts: 204
19 Jan 2012 01:26 PM
When i copy&past it rightaway from you it doesn't seem to work ;s
there are 6 camera script in main script
camera1
camera2
camera3
camera4
camera5
camera6

and if the first value is true it gives camera1 script and puts value false
and so on..
So do i need to edit a small thing in it?
Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
19 Jan 2012 01:30 PM
is the name on the camera scripts "camera#" or "Camera#"?
Report Abuse
Nicothefunky is not online. Nicothefunky
Joined: 10 Jul 2008
Total Posts: 204
19 Jan 2012 01:32 PM
it was camera ahah! Seems to work now man,
that's some real advanced scripting u got there...
Thanks so mutch!!
One more question: how long did u do to get so good :O

I like really started a month ago or something and i don't understand a thing in ur script lol, but wtf thanks man!

U rock
Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
19 Jan 2012 01:36 PM
I learned it on less one month.
Report Abuse
Nicothefunky is not online. Nicothefunky
Joined: 10 Jul 2008
Total Posts: 204
19 Jan 2012 01:37 PM
Wow you rock..
Learned it on your own from wiki?
Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
19 Jan 2012 01:37 PM
It is not the first programming-language I have learned. I can many more programming-languages.
Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
19 Jan 2012 01:38 PM
yes and skills I have from other programming-languages.
Report Abuse
Nicothefunky is not online. Nicothefunky
Joined: 10 Jul 2008
Total Posts: 204
19 Jan 2012 01:39 PM
Nice!
Keep on doing good work man!
Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
19 Jan 2012 01:48 PM
thanks
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