Yes! It worked! Thanks soooo much!
No problem, if it worked please give the solution to the message
1 Like
This will work too if you want to try it
local player = game:GetService('Players').LocalPlayer
local character = player.Character
local gui = script.Parent.Parent
local blur = game:GetService('Lighting'):WaitForChild('Blur')
local button = script.Parent
local button1 = script.Parent.Parent['Train Driver']
local button2 = script.Parent.Parent['Bus Driver']
local button3 = script.Parent.Parent['Civilian']
counter = 0
button.MouseButton1Click:Connect(function()
button1.Visible = false
button2.Visible = false
button3.Visible = false
blur.Size = 20
repeat
counter = counter + 1
blur.Size = blur.Size - 2
wait(.3)
until counter == 10
counter = 0
end)
The script you provided could still run into those same issues (the character isnât being waited for, the replication of various instances isnât being waited for etc.). You also reference the playerâs characterâs humanoid instance sub-optimally twice.
local players = game:GetService("Players")
local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
humanoid.WalkSpeed = 0
local lighting = game:GetService("Lighting")
local blur = lighting:WaitForChild("Blur")
blur.Enabled = true
local button = script.Parent
local frame = button.Parent
local trainDriver = frame:WaitForChild("Train Driver")
local civilian = frame:WaitForChild("Civilian")
button.Visible = true
local tweens = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(3)
local tween = tweens:Create(blur, TweenInfo.new(3), {Size = 0})
button.MouseButton1Click:Connect(function()
humanoid.WalkSpeed = 16
button.Visible = false
trainDriver.Visible = false
civilian.Visible = false
tween:Play()
tween.Completed:Wait()
end)