So this goes along with a question that I've previously asked (which has been answered). Here's the script again:
wait(1)
character = game.Players:findFirstChild(""..game.Workspace.ValueHold.Player.Value.."")
local t = game.Workspace.ValueHold.RoomCount
t.Changed:connect(function()
print("Changing Room...")
local r = math.random(1,3)
if r == 1 then
local room = game.ServerStorage.defroom1:Clone()
room.Parent = game.Workspace
game.Workspace.ValueHold.CurrentRoom.Value = 1
character.Character.Torso.CFrame = CFrame.new(game.Workspace.defroom1.spawn.Position)
elseif r == 2 then
local room2 = game.ServerStorage.defroom2:Clone()
room2.Parent = game.Workspace
game.Workspace.ValueHold.CurrentRoom.Value = 2
character.Character.Torso.CFrame = CFrame.new(game.Workspace.defroom2.spawn.Position)
elseif r == 3 then
local room3 = game.ServerStorage.defroom3:Clone()
room3.Parent = game.Workspace
game.Workspace.ValueHold.CurrentRoom.Value = 3
character.Character.Torso.CFrame = CFrame.new(game.Workspace.defroom3.spawn.Position)
end
end)
Now, time for me to explain. So, you touch a button, you get teleported to a new room, that room has a button that does the same thing, yadda yadda yadda, nothing important, until you get to the actual teleporting part. So, I have a value that stores the players name upon entering the game. So, if your name is "awesomedude123", then the value changes to "awesomedude123". The beginning of the script defines "character" as "awesomedude123", and when a random room is picked, it takes "character" and teleports him to a new room. Same story as my last problem: Works In test mode, but not in a server. I've been told to add a "wait(1)' before it, and that should fix the problem, but it doesn't.
All help is greatly appreciated.

3 comments
Is this a localscript?
Is this single player?
Add a print("Hello World!") after the character variable. Does the server print Hello World! or not in the output window?