I have used tweens to make a welcome screen i want to execute the event for it to run for a user on run but it keeps giving me this error:
Here is the code:
Code
local event = game.ReplicatedStorage.StageCam
game.Players.PlayerAdded:Connect(function(player)
workspace.yourname.Value = player.Name
print(player.Name .. " joined!")
local pna = player.Name
local pid = player.UserId
event:FireClient(player.UserId)
end)
Please get back to me.
You are using an ObjectValue im guessing… assign it to a part from workspace by simply just doing something using getservice and waitforchild
No I am not, I want to to RUN the remove event when someone joines…
SOTR654:
event:FireClient(player)
Here is the original from when it was a command. game.ReplicatedStorage.StageCam:FireAllClients(player.Name, player.UserId)
Rami_XD1
(RamiDeV)
July 28, 2021, 12:56pm
6
You don’t need to create a special event to tween the camera when the player join the game , just put this script in StarterPlayerScripts and will automatically run when the player join the game
1 Like
Ok however this would make it happen when ever they reset, How can i do it when they only get it happen when they first join? (local script)
1 Like
Rami_XD1
(RamiDeV)
July 28, 2021, 5:44pm
8
Add bool Value to ReplicatedStorage and activate it for the first time
and Let the script check if this value is false then can tween the camera
Rami_XD1
(RamiDeV)
July 28, 2021, 5:49pm
9
here try this
local RS = game:GetService("ReplicatedStorage")
local IsFirstJoin = RS:FindFirstChild("IsFirstJoin")
if not IsFirstJoin then
local v = Instance.new("BoolValue", RS)
v.Name = "IsFirstJoin"
-- Tween the Camera
end