Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

[PLEASE TWEAK]My script wont work, trying to make this script only work for the "alive" team, why?

ok so the teams folder is named "Teams" and the team is named "Alive" the script wont function at all because its not a proper function, this is the error: : Incomplete statement: expected assignment or a function call this script is in starterplayerscripts its a localscript btw this is the script:

game.Players.LocalPlayer
if player.Alive.Name == "Alive" then
	local player = game.Players.LocalPlayer

local StarterGui = player.PlayerGui
local UserInputService = game:GetService("UserInputService")
UserInputService.JumpRequest:Connect(function()
	StarterGui.ScreenGui.Frame.Visible = true
	wait(6)
	StarterGui.ScreenGui.Frame.Visible =  false
end)
end



if this isnt enough info just say in the comments what i need to say and ill edit the question.

[PLEASE HELP]

5 comments

0

isn't it missing something? line 1 seems to be cut

0

line 1 is the error

0

please complete it it says its incomplete, but i had to define player so i put that

0

Umm so what do you exactly want to achieve?

0

line 1 should be local player = game.Players.LocalPlayer

1 answer

✓ Accepted answer

Line 1 is incompleted, I gonna replace line 1 with line 3. Also you are checking Team incorrectly

local player = game.Players.LocalPlayer
if player.TeamColor == game.Team.Alive.TeamColor then

local StarterGui = player.PlayerGui
local UserInputService = game:GetService("UserInputService")
UserInputService.JumpRequest:Connect(function()
    StarterGui.ScreenGui.Frame.Visible = true
    wait(6)
    StarterGui.ScreenGui.Frame.Visible =  false
end)
end

This discussion is preserved as it was. New answers, comments, and votes are closed.