AdSomnum
(Kai)
November 22, 2022, 8:01am
#1
i need to go to school so i will check this after i get home, thanks for any help.
local script in starterplayerscripts, trying to tween a blur when a player joins
nothing printing, not sizing the blur, not playing the tween
script:
local TweenService = game:GetService("TweenService")
local info = TweenInfo.new(10, Enum.EasingStyle.Quad, Enum.EasingDirection.In)
local goal = {Size = 0}
local tween = TweenService:Create(game:GetService("Lighting"):WaitForChild("JoinBlur"), info, goal)
game.Players.PlayerAdded:Connect(function()
print("joined")
game:GetService("Lighting"):WaitForChild("JoinBlur").Enabled = true
game:GetService("Lighting"):WaitForChild("JoinBlur")
print("size 35")
tween:Play()
print("tween started")
end)
What i want u to do first is add a local for the join blur. It will clean up the script
I assume this is from a server script?
That will not work, well it would work for the very first player.
Instead when a player joins, on the client do something like:
-- localscript
local Player = game:GetService("Players").LocalPlayer
local TweenService = game:GetService("TweenService")
local info = TweenInfo.new(10, Enum.EasingStyle.Quad, Enum.EasingDirection.In)
local goal = {Size = 0}
local tween = TweenService:Create(game:GetService("Lighting"):WaitForChild("JoinBlur"), info, goal)
Player.CharacterAdded:Connect(function(Character)
tween:Play()
end)
If you want it to work just sometime after they’ve joined, but not really when their character have spawned, just do a task.wait(5) or something in a localscript in the StarterGui, followed up with the whole tween thing.
AdSomnum
(Kai)
November 22, 2022, 4:37pm
#4
it’s a local script
this would make it happen every time they spawn
i only want it when they join
AdSomnum
(Kai)
November 22, 2022, 4:40pm
#5
i don’t really care what you want me to do.
i had a variable for the blur and changed it as i wasnt sure it was actually getting the blur.
your post is off topic.
i asked for help with the script, not to make a variable.
Did u check the output logs for any errors? Because that is the key to fixing it.
xGOA7x
(Cairo)
November 22, 2022, 5:21pm
#7
If you want to Screen to Blur When the Player Joins the game, and not when they respawn and stuff, just do this:
Lighting = game:GetService("Lighting")
JoinBlur = Lighting:WaitForChild("JoinBlur", 5)
JoinBlur.Enabled = true
repeat wait() until game:IsLoaded() -- Waits Until the game is fully Loaded
TweenService = game.TweenService
Player = game.Players.LocalPlayer
JoinBlur.Size = 35
TweenService:Create(JoinBlur, TweenInfo.new(10), {Size = 0}):Play()
This Should only run once
Are you sure you want to do it when another player joins? I don’t think the player added event would fire after the player’s scripts are loaded.
Try removing the player added event.
1 Like
AdSomnum
(Kai)
November 22, 2022, 5:26pm
#9
didn’t work
i pasted the script in a local script in starter player scripts
xGOA7x
(Cairo)
November 22, 2022, 5:26pm
#10
Are you sure?
Im testing it currently, works for me
Is your Script Enabled?
AdSomnum
(Kai)
November 22, 2022, 5:27pm
#11
yes the script is enabled.
i pasted the script directly into StarterPlayerScripts in a local script.
xGOA7x
(Cairo)
November 22, 2022, 5:27pm
#12
Can you please show the Script and Explorer?
Also please note you need to wait until its finished
AdSomnum
(Kai)
November 22, 2022, 5:29pm
#13
It worked when I removed the player added event from my old script, however your script didn’t work for me for some reason
AdSomnum
(Kai)
November 22, 2022, 5:29pm
#14
Removing the player added event worked! thank you
system
(system)
Closed
December 6, 2022, 5:30pm
#15
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.