Erebodis
|
  |
| Joined: 22 Jan 2011 |
| Total Posts: 96 |
|
|
| 15 Sep 2016 03:56 AM |
This script only seems to work when the player joins the game e.e And not when they respawn. Could anyone explain?
local target = CFrame.new(54, 82, 222)
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) if player:IsInGroup(2941398) and player:GetRankInGroup(2941398) > 4 then character:WaitForChild("Torso") character.Torso.CFrame = target end end) end) |
|
|
| Report Abuse |
|
|
HlCOM
|
  |
| Joined: 29 Mar 2009 |
| Total Posts: 3332 |
|
|
| 15 Sep 2016 04:05 AM |
the PlayerAdded line is when a player joins the game, this should work
player.CharacterAdded:connect(function(character) if player:IsInGroup(2941398) and player:GetRankInGroup(2941398) > 4 then character:WaitForChild("Torso") character.Torso.CFrame = target end end) |
|
|
| Report Abuse |
|
|
HlCOM
|
  |
| Joined: 29 Mar 2009 |
| Total Posts: 3332 |
|
|
| 15 Sep 2016 04:05 AM |
| nevermind give me a sec or if someone else swoops in they swoop in but this wont work either lol sorry its late |
|
|
| Report Abuse |
|
|
Erebodis
|
  |
| Joined: 22 Jan 2011 |
| Total Posts: 96 |
|
|
| 15 Sep 2016 04:12 AM |
| Ohhhhmk. I can probs work out the rest for the directories. Thanks man. |
|
|
| Report Abuse |
|
|
Erebodis
|
  |
| Joined: 22 Jan 2011 |
| Total Posts: 96 |
|
|
| 15 Sep 2016 04:14 AM |
| Ok yeah nvm found your predicament e.e |
|
|
| Report Abuse |
|
|
HlCOM
|
  |
| Joined: 29 Mar 2009 |
| Total Posts: 3332 |
|
|
| 15 Sep 2016 04:20 AM |
assuming this is a local script
player = game.Players.LocalPlayer local target = CFrame.new(54, 82, 222)
player.CharacterAdded:connect(function(character) if player:IsInGroup(2941398) and player:GetRankInGroup(2941398) > 4 then character:WaitForChild("Torso") wait() character.Torso.CFrame = target end end)
didn't work without the wait() either, so now it waits for the WaitForChild before going ahead
|
|
|
| Report Abuse |
|
|
Erebodis
|
  |
| Joined: 22 Jan 2011 |
| Total Posts: 96 |
|
| |
|
Erebodis
|
  |
| Joined: 22 Jan 2011 |
| Total Posts: 96 |
|
|
| 15 Sep 2016 04:34 AM |
| The different assignment of Player to Players makes the group conditions invalid I think :/ Should be able to work it out myself but it's taking a while e.e |
|
|
| Report Abuse |
|
|
HlCOM
|
  |
| Joined: 29 Mar 2009 |
| Total Posts: 3332 |
|
|
| 15 Sep 2016 04:38 AM |
| I tested it with one of my groups and it fully worked, are you making it a LocalScript inside of StarterGui? |
|
|
| Report Abuse |
|
|
Erebodis
|
  |
| Joined: 22 Jan 2011 |
| Total Posts: 96 |
|
|
| 15 Sep 2016 04:52 AM |
| Oh no I wasn't. I was just leaving it in the workspace e.e Thank you so much :/ Seen local scripts been put there before, I should've hooked on to the fact it was due to it include various Starter equipment? |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 15 Sep 2016 08:13 AM |
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) if player:IsInGroup(2941398) and (player:GetRankInGroup(2941398) > 4) then print('Pass') local torso = char:WaitForChild('Torso') torso.CFrame = CFrame.new(54,82,222) end end) end)
|
|
|
| Report Abuse |
|
|
Erebodis
|
  |
| Joined: 22 Jan 2011 |
| Total Posts: 96 |
|
|
| 15 Sep 2016 08:13 AM |
Pretty sure that didn't run for respawning. That was the issue
210,605 slices of pizza and counting |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2016 08:16 AM |
local: wait(0.08) local c = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:wait() c:WaitForChild("Torso").CFrame = target
server: game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(char) char:WaitForChild("Torso").CFrame = target end) end) |
|
|
| Report Abuse |
|
|
Erebodis
|
  |
| Joined: 22 Jan 2011 |
| Total Posts: 96 |
|
|
| 15 Sep 2016 08:18 AM |
The server one didn't seem to work.
210,605 slices of pizza and counting |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2016 08:20 AM |
it should always work idk what youre doing wrong |
|
|
| Report Abuse |
|
|
Erebodis
|
  |
| Joined: 22 Jan 2011 |
| Total Posts: 96 |
|
|
| 15 Sep 2016 08:22 AM |
ikr e.e If the answer isn't in the code above, guess there must be something else in the game conflicting..... Somehow 0.o
Ty guys.
210,605 slices of pizza and counting |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2016 08:23 AM |
make a new baseplate and put a script in the workspace
put my server code and make sure you have 'target' defined then play and reset |
|
|
| Report Abuse |
|
|
Erebodis
|
  |
| Joined: 22 Jan 2011 |
| Total Posts: 96 |
|
|
| 15 Sep 2016 09:03 AM |
Yeah, doesn't work for me then either. Only triggers on initial spawn when enters the server.
Local script works fine.
210,648 slices of pizza and counting |
|
|
| Report Abuse |
|
|