Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Attempt Ver: [V0.4] LocalScript isn't running + no errors, Please help! Have Links [?]

Asked by 6 years ago
Edited 6 years ago

Notes:

  1. This is a local script inside A text label inside guis

  2. NO Filtering Enabled

local BattleFrame = script.Parent.Parent:WaitForChild('BattleFrame')
local IntroText = script.Parent
local W = 0.07
local BlurEffect = game.Lighting:WaitForChild('Blur')
local AOP = game.ReplicatedStorage:WaitForChild('AmountOfPlayers')



game.Players.PlayerAdded:Connect(function()
    wait()
    if game.Players.NumPlayers == 1 then
        BlurEffect.Size = 24
        IntroText.Visible = true
        wait(2)
        IntroText.Text = 'Need one more player!'
        wait(5)
        IntroText.Text = 'Loading.'
        wait(1)
        IntroText.Text = 'Loading..'
        wait(1)
        IntroText.Text = 'Loading...'
        wait(2)
        IntroText.Text = 'Need one more player!'
        wait(5)
        IntroText.Text = 'Waiting...'
        game.Players.NumPlayers.Changed:Connect(function()
            if AOP.Value == 2 then
                wait(3)
                IntroText.Text = 'Ready?'
                wait(3)
                IntroText.Text = 'Set?'
                wait(3)
                IntroText.Text = 'FIGHT!'
                wait(3)
                IntroText.Visible = false
                BlurEffect.Size = 0
                wait(W)
                BattleFrame.Visible = true
            end
        end)
    end
end)

[PROBLEM]; When joining the game, nothing runs. No blue, no text label, no nothing. So I need to know why this isn't running and how to fix it.

If you wanna try yourself;

NOTE

  1. When you join, there's suppose to be a blue with a text label in the center saying "Loading". But nothing happens

https://web.roblox.com/games/975537457/Red-V-S-Blue-Tower-Defense-BETA-TESTING

0
Put that in a link thing. hiimgoodpack 2009 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago

You have two player variables, you would not need the function. A playeradded function is only recommended for server scripts.

Instead of that function, try this function:

plr.PlayerAdded:connect(function()

end)

Unless you use a server script, you would need to use the PlayerAdded event from the service Players since server scripts cannot access LocalPlayer.

If my answer helped you, please don't forget to accept it!

_____________________________

EDIT: Instead of having a value that checks for the amount of players available, use the service Players instead as it has a property that can read the amount of players in the server.

0
I'm sorry to ask but, can you rewrite the code that is fixed? I don't understand what to add and remove. If you can't do that, that's find as well. Thanks! I will wait for a reply BlackOrange3343 2676 — 6y
0
I made a mistake, I accidentally added the localplayer variable somehow, try again, I re-edited it. User#18043 95 — 6y
0
Aww so you won't re-write the script for me? ok ;~; BlackOrange3343 2676 — 6y
0
btw: PlayerAdded is not a valid member of Player BlackOrange3343 2676 — 6y
View all comments (10 more)
0
change plr to game:GetService("Players") User#18043 95 — 6y
0
god dammit i keep making mistakes am i having brain farts all over the place User#18043 95 — 6y
0
I edited my script, take a look at my question's script again i will show you now, it still doesn't work. BlackOrange3343 2676 — 6y
0
Doesn't work. Please help me fix. BlackOrange3343 2676 — 6y
0
SMH DUDE I SAID USE .NumPlayers for PLAYERS not the AOP VALUE User#18043 95 — 6y
0
I don't know how. Please ;-;. it would help so much if you did cause I don't know properties of Player. Please re-write code BlackOrange3343 2676 — 6y
0
I have been looking at other question and I know your answers are beautifully written and nicely organized but I really need help ;-; BlackOrange3343 2676 — 6y
0
uhh its instead of AOP.Value it would be game.Players.NumPlayers User#18043 95 — 6y
0
I wish you could just write entire code again with the fixed parts BlackOrange3343 2676 — 6y
0
And it doesn't work BlackOrange3343 2676 — 6y
Ad

Answer this question