Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Where that script needs to be placed?

Im using the next script:

local pos = Vector3.new(-46.078, 5.046, -1105.82)
local stats = game.Players.LocalPlayer.leaderstats 
local objects = Instance.new("IntValue", stats)
local char = game.Players.LocalPlayer.Character
local tor = char:WaitForChild("Torso") 
	 
objects.Changed:Connect(function()
if objects.Value == 1 then
  tor.CFrame=CFrame.new(pos)
	else print("Objects value isn't 5")
	end
	end)

YOu need to be teleported when your stats named "Objects" are = 5 But i dont know where i need to place then script,or if it needs to be local

2 answers

✓ Accepted answer

Hello,

It needs to be a local script because you used game.Players.LocalPlayer.leaderstats (and game.Players.LocalPlayer.Character) , in order to make it work in filtering enabled, you must NOT use local scripts and you have to use remote events, to specify the player.leaderstats use the player added event.

~Frag

3 comments

0

So,Can i turn off filtering?

0

if you want 0 players in your game turn it off

0

Thanks,my game have single player and multiplayer,for multiplayer,What i need to change for teleport all players?

In serverscript service

1 comment

0

Actually doesnt working ,Maybe something wrong in the script?

This discussion is preserved as it was. New answers, comments, and votes are closed.