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 » Club Houses » ROBLOX Talk
Home Search
 

Re: i still dont understand why this wont work

Previous Thread :: Next Thread 
Interactivity is not online. Interactivity
Joined: 03 Dec 2011
Total Posts: 23738
21 Jul 2014 08:08 AM
whenever i join the game, the first person lock is fine
but whenever i die, you're switched back to regular camera mode
what???

game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(char)
wait(0.1)
p.CameraMode="LockFirstPerson"
end)
end)
Report Abuse
LuigiLuigi6789 is not online. LuigiLuigi6789
Joined: 10 Jun 2012
Total Posts: 9563
21 Jul 2014 08:09 AM
>player added

~ generic oder quote ~
Report Abuse
Keldogon is not online. Keldogon
Joined: 22 Jan 2011
Total Posts: 25999
21 Jul 2014 08:11 AM
probably when it dies its not a player anymore
Report Abuse
Interactivity is not online. Interactivity
Joined: 03 Dec 2011
Total Posts: 23738
21 Jul 2014 08:11 AM
o
how do i make it on spawn

get the shotgun, i'll handle this
Report Abuse
Interactivity is not online. Interactivity
Joined: 03 Dec 2011
Total Posts: 23738
21 Jul 2014 08:18 AM
no im serious

get the shotgun, i'll handle this
Report Abuse
Jman88s is not online. Jman88s
Joined: 11 Dec 2011
Total Posts: 19445
21 Jul 2014 08:19 AM
ask someone else

| Jman88s |
Report Abuse
Jazzyforcefield is not online. Jazzyforcefield
Joined: 12 Jan 2010
Total Posts: 18838
21 Jul 2014 08:20 AM
Let me test it out.
Report Abuse
Jazzyforcefield is not online. Jazzyforcefield
Joined: 12 Jan 2010
Total Posts: 18838
21 Jul 2014 08:23 AM
I don't see what's wrong. I tested it out and I keep spawning in first person.
Report Abuse
Phyclops is not online. Phyclops
Joined: 27 Sep 2012
Total Posts: 5895
21 Jul 2014 08:24 AM
change char.CameraMode to lockfirst person too.
you're only changing playeradded. not characteradded.
Report Abuse
Jazzyforcefield is not online. Jazzyforcefield
Joined: 12 Jan 2010
Total Posts: 18838
21 Jul 2014 08:27 AM
CameraMode is not a member of character. Camera is in the workspace.
Report Abuse
Interactivity is not online. Interactivity
Joined: 03 Dec 2011
Total Posts: 23738
21 Jul 2014 08:36 AM
"I don't see what's wrong. I tested it out and I keep spawning in first person."
the problem is it doesnt work ingame
only works in test mode

get the shotgun, i'll handle this
Report Abuse
bibbs123 is not online. bibbs123
Joined: 03 Jun 2008
Total Posts: 24994
21 Jul 2014 08:38 AM
you have to make it do it on respawn

do characteradded. it resets when you die and your script only triggers when a player is added, which is only when you join the game
Report Abuse
Interactivity is not online. Interactivity
Joined: 03 Dec 2011
Total Posts: 23738
21 Jul 2014 08:41 AM
@bibbs
i did this and it doesnt work
i have to be doing something wrong

game.Players.CharacterAdded:connect(function(p)
p.CharacterAdded:connect(function(char)
wait(0.1)
p.CameraMode="LockFirstPerson"
end)
end)
Report Abuse
Interactivity is not online. Interactivity
Joined: 03 Dec 2011
Total Posts: 23738
21 Jul 2014 08:42 AM
i forgot to mention
its a localscript and its in startergui
so

get the shotgun, i'll handle this
Report Abuse
bibbs123 is not online. bibbs123
Joined: 03 Jun 2008
Total Posts: 24994
21 Jul 2014 08:44 AM
function onAdded(c)
wait(0.1)
game.Players[p.Name].CameraMode="LockFirstPerson"
end

game.Players.PlayerAdded:connect(onAdded)
workspace.ChildAdded:connect(onRespawn)
for _,player in pairs(game.Players:GetPlayers()) do
onAdded(player)
end

possibly
Report Abuse
bibbs123 is not online. bibbs123
Joined: 03 Jun 2008
Total Posts: 24994
21 Jul 2014 08:44 AM
dammit, i forgot to switch a variable

function onAdded(c)
wait(0.1)
game.Players[c.Name].CameraMode="LockFirstPerson"
end

game.Players.PlayerAdded:connect(onAdded)
workspace.ChildAdded:connect(onRespawn)
for _,player in pairs(game.Players:GetPlayers()) do
onAdded(player)
end
Report Abuse
bibbs123 is not online. bibbs123
Joined: 03 Jun 2008
Total Posts: 24994
21 Jul 2014 08:46 AM
sorry, one more thing. i'm just editing another script of mine and i forgot this part

assuming cameramode IS a part of player, idk if it is, im going with what you had

function onRespawn(c)
wait(0.1)
game.Players[c.Name].CameraMode="LockFirstPerson"
end

function onAdded(p)
wait(0.1)
p.CameraMode="LockFirstPerson"
end

game.Players.PlayerAdded:connect(onAdded)
workspace.ChildAdded:connect(onRespawn)
for _,player in pairs(game.Players:GetPlayers()) do
onAdded(player)
end
Report Abuse
Interactivity is not online. Interactivity
Joined: 03 Dec 2011
Total Posts: 23738
21 Jul 2014 08:46 AM
@bibbs
so i make that a localscript and then put it in startgui?
ok

get the shotgun, i'll handle this
Report Abuse
bibbs123 is not online. bibbs123
Joined: 03 Jun 2008
Total Posts: 24994
21 Jul 2014 08:47 AM
no, i just have it in the workspace
Report Abuse
bibbs123 is not online. bibbs123
Joined: 03 Jun 2008
Total Posts: 24994
21 Jul 2014 08:49 AM
crap hang on

function onRespawn(c)
if(game.Players:FindFirstChild(c.Name))then
wait(0.1)
game.Players[c.Name].CameraMode="LockFirstPerson"
end
end

function onAdded(p)
wait(0.1)
p.CameraMode="LockFirstPerson"
end

game.Players.PlayerAdded:connect(onAdded)
workspace.ChildAdded:connect(onRespawn)
for _,player in pairs(game.Players:GetPlayers()) do
onAdded(player)
end
Report Abuse
Interactivity is not online. Interactivity
Joined: 03 Dec 2011
Total Posts: 23738
21 Jul 2014 08:50 AM
@bibbs
follow me
place is called no

get the shotgun, i'll handle this
Report Abuse
bibbs123 is not online. bibbs123
Joined: 03 Jun 2008
Total Posts: 24994
21 Jul 2014 08:50 AM
function onRespawn(c)
if(game.Players:FindFirstChild(c.Name))then
wait(0.1)
game.Players[c.Name].CameraMode="LockFirstPerson"
end
end

workspace.ChildAdded:connect(onRespawn)

you know what, i feel stupid
try that
it's shorter and it should probably work better and faster
i haven't scripted in a while lol

make it a script in the workspace
Report Abuse
Phyclops is not online. Phyclops
Joined: 27 Sep 2012
Total Posts: 5895
21 Jul 2014 08:52 AM
master scripter bibby pls, help me

SetPrimaryPartCFrame rounds the angle to the nearest 90 degree?
also, how would I make the ghost model auto update to the angle without me having to reselect the tool.
.Changed?
not sure how to do it


local bin = script.Parent
local shelter = game.ReplicatedStorage.Shelter
local amt = bin:FindFirstChild("Amount")

local ghost = nil

function makeGhost()
ghost = shelter:clone()
ghost.Parent = game.Workspace.CurrentCamera
ghost:MakeJoints()
ghost.PrimaryPart=ghost.MainPart
local g = ghost:GetChildren()
ghost:SetPrimaryPartCFrame(bin.Parent:FindFirstChild("Torso").CFrame - bin.Parent:FindFirstChild("Torso").Position)
for i = 1,#g do
if g[i]:IsA("Part") and g[i].Transparency ~= 1 then
g[i].Transparency = 0.7
g[i].BrickColor = BrickColor.new("Lime green")
g[i].CanCollide = false
end
end
end

function onButton1Down(mouse)
ghost:Destroy()
local model = shelter:clone()
model.Parent = game.Workspace
model:MakeJoints()
model:MoveTo(mouse.Hit.p)
local f = model:GetChildren()
for i = 1, #f do
if f[i]:IsA("Part") then
f[i].Anchored = true
end
end
amt.Value = amt.Value - 1
if amt.Value == 0 then
bin:Destroy()
if ghost then
ghost:Destroy()
ghost = nil
end
end
makeGhost()
end

bin.Equipped:connect(function(mouse)
makeGhost()
mouse.Move:connect(function()
if ghost then
mouse.TargetFilter = ghost
ghost:MoveTo(mouse.Hit.p)
end
end)
mouse.Icon = "rbxasset://textures\\GunCursor.png"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end)
bin.Unequipped:connect(function()
if ghost then
ghost:Destroy()
end
end)
Report Abuse
Interactivity is not online. Interactivity
Joined: 03 Dec 2011
Total Posts: 23738
21 Jul 2014 08:52 AM
wdf where is the chat bar?

get the shotgun, i'll handle this
Report Abuse
Interactivity is not online. Interactivity
Joined: 03 Dec 2011
Total Posts: 23738
21 Jul 2014 08:53 AM
HOW DID I EVEN
WHAT
LOL

get the shotgun, i'll handle this
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Club Houses » ROBLOX Talk
   
 
   
  • 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