local Guest = script.Parent;
local Humanoid = Guest:WaitForChild("Humanoid");
local Hotel = Guest.Parent.Parent;
local Next = Hotel:WaitForChild("Next");
local Queue = Hotel:WaitForChild("Queue");
Humanoid:MoveTo(Queue.Position)
local Deb = false;
local function Go_To_Room()
print("Going to my room :)")
Guest:Destroy();
end;
Next:GetPropertyChangedSignal("Value"):Connect(function()
if not Deb then
Deb = true;
Go_To_Room();
end
end);
Output:
19:28:54.919 Going to my room :) - Server
19:28:54.920 Going to my room :) - Server
It shouldnât be printing twice, so Iâm assuming the script was cloned somehow? You should print(script) instead of the other thing, to see if thatâs the case. Click the Script in the output to see where both are.
I will post both my scripts here, one is changing Next.Value with proximity function.
First:
local Hotel = script.Parent;
local Guests_Folder = Hotel:WaitForChild("Guests");
local Guests_Spawn = Hotel:WaitForChild("Guests_Spawn");
--;
local Owner = Hotel:WaitForChild("Owner");
local Next = Hotel:WaitForChild("Next");
--;
local Check_In = Hotel:WaitForChild("Check_In");
local Check_In_Proxi = Check_In:WaitForChild("ProximityPrompt");
--// CREATE GUEST
local function Create_Guest()
local Guest_Clone = Guest:Clone();
Guest_Clone.Parent = Guests_Folder;
Guest_Clone:MoveTo(Guests_Spawn.Position);
Guest_Clone:FindFirstChild("Functions").Enabled = true;
end;
--// WHILE WAIT
repeat wait(.1) until Owner.Value
if (Owner.Value) then
print("Creating Guest")
Create_Guest()
end;
Check_In_Proxi.Triggered:Connect(function()
print("Checked In")
local Guest_Clone = Guest:Clone();
Guest_Clone.Parent = Guests_Folder;
Guest_Clone:MoveTo(Guests_Spawn.Position);
Guest_Clone:FindFirstChild("Functions").Enabled = true;
Next.Value = Next.Value + 1;
end);
Second inside guest:
local Guest = script.Parent;
local Humanoid = Guest:WaitForChild("Humanoid");
local Hotel = Guest.Parent.Parent;
local Next = Hotel:WaitForChild("Next");
local Queue = Hotel:WaitForChild("Queue");
Humanoid:MoveTo(Queue.Position)
local function Go_To_Room()
print(script)
end;
Next:GetPropertyChangedSignal("Value"):Once(Go_To_Room);
Output after proximity triggered:
19:51:50.072 Creating Guest - Server - Guest_Control:32
19:51:54.978 Checked In - Server - Guest_Control:37
19:51:54.981 Functions - Server - Functions:13
19:51:54.981 Functions - Server - Functions:13
if (Owner.Value) then
print("Creating Guest")
Create_Guest()
end;
Create_Guest() creates a clone of Gest and executes the Functions script where a first connection to Next:GetPropertyChangedSignal(âValueâ) is created.
And when Check_In_Proxi is triggered a second connection to Next:GetPropertyChangedSignal(âValueâ) is created.