I need to award points appropriately. I did this by checking their torso material. Well, Roblox has been giving me an error (Explorer: http://imgur.com/ne1oerR). I suspected the line of code was line 38 as I probed the code. (Script: https://kobra.io/#/e/-KEH8mW3w9bv9hy-lL-u) I would appreciate an answer. I am so close to finishing my game!!!

Code:

function timer(timecountdown)
	local timerValue = timecountdown
while timerValue ~= 0 do
	wait(1)
	timerValue = timerValue - 1
	for i, v in   pairs(game.Players:GetChildren()) do
		v.PlayerGui.ScreenGui.TextLabel.Text = timerValue
	end
end
end

function timerhide(timecountdownhide)
	local timerValuehide = timecountdownhide
while timerValuehide ~= 0 do
	wait(1)
	timerValuehide = timerValuehide - 1
	for i, v in pairs(game.Players:GetChildren()) do
		v.PlayerGui.ScreenGui.TextLabel.Text = "Time Left To Hide: " .. timerValuehide
	end
end
end

function timeri(timei)
	local timerValuei = timei
while timerValuei ~= 0 do
	wait(1)
	timerValuei = timerValuei - 1
	for i, v in pairs(game.Players:GetChildren()) do
		v.PlayerGui:WaitForChild("ScreenGui")
			v.PlayerGui.ScreenGui.TextLabel.Text = "Intermission: " .. timerValuei
	end
end

end

while true do 
	print("23")
	for i, v in   pairs(game.Players:GetChildren()) do
		if v.Character.Torso.Material == Enum.Material.Plastic then
			game.Workspace.Jackel.SurfaceGui.TextLabel.Text = v.Name .. ", "
			v.leaderstats.sCoins.Value = v.leaderstats.sCoins.Value + 200
		end
		v:LoadCharacter()
	end
	
		timeri(10)	
	
	for i, v in  pairs(game.Players:GetChildren()) do
			v.PlayerGui.ScreenGui.TextLabel.Text = "Teleporting Players..."
	end
		


for i, v in   pairs(game.Players:GetChildren()) do  v.Character.Torso.CFrame = CFrame.new(Vector3.new(-126.7, 41.61, -141.1)) -- Change numbers to whatever	
wait(1)
v.PlayerGui.ScreenGui.TextLabel.Text = ""
wait(1)

end


timerhide(20)
for i, v in pairs(game.Players:GetChildren()) do 
v.PlayerGui.ScreenGui.TextLabel.Text = "The Illness Has Been Let Out!"
end

wait(1)
local iCopy = game.ServerStorage.DFDIllness:Clone()
iCopy.Parent = game.Workspace
iCopy:MakeJoints()
timer(90)

for i, v in pairs(game.Players:GetChildren()) do
v.PlayerGui.ScreenGui.TextLabel.Text = "Game Ended"

end
wait(1)
for i, v in pairs(game.Players:GetChildren()) do
	v.PlayerGui.ScreenGui.TextLabel.Text = "Teleporting Players Back..."
end
wait(1)




for i, v in   pairs(game.Players:GetChildren()) do  v.Character.Torso.CFrame = CFrame.new(Vector3.new(13.06, 68.92, -2.18)) -- Change numbers to whatever	
v.PlayerGui.ScreenGui.TextLabel.Text = ""

end


game.Workspace.DFDIllness:Destroy()

end

1 comment

0

If filtering enabled is on then you can't access the player GUI with server scripts and you can't change things in the server with local scripts and expect it to replicate to the server.