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

[SOLVED]why do i have a error at the end i am getting a headache because i cant figure it out?

local block = game.Workspace.JoiningReward.JoiningRewardBlock
local player = game.Players.LocalPlayer
block.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
    if player.CodesUsed.Codes.Value == 0 then
        player.CodesUsed.Codes.Value = player.CodesUsed.Codes.Value +1
        player.leaderstats.Swings.Value = player.leaderstats.Swings.Value +250
		 print("Player Recieved Price!")        
				block.JoiningRewardGui.BillboardGui.Text.Text = " "	
    	else   
		if player.CodesUsed.Codes.Value >= 1 then
					print("Player Already Recieved Price!")
				player.leaderstats.Swings.Value = player.leaderstats.Swings.Value +250
		player.leaderstats.Swings.Value = player.leaderstats.Swings.Value -250
				end
  			end
		 end
		end)
end)

2 comments

1

why do you got 2 end)'s LIKE BRO

0

If you properly indented your code this woulnt be such a problem

1 answer

NVM!! GOT IT!!

local block = game.Workspace.JoiningReward.JoiningRewardBlock
local player = game.Players.LocalPlayer
block.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
    if player.CodesUsed.Codes.Value == 0 then
        player.CodesUsed.Codes.Value = player.CodesUsed.Codes.Value +1
        player.leaderstats.Swings.Value = player.leaderstats.Swings.Value +250
		 print("Player Recieved Price!")        
				block.JoiningRewardGui.BillboardGui.Text.Text = " "	
    	else   
		if player.CodesUsed.Codes.Value >= 1 then
					print("Player Already Recieved Price!")
				player.leaderstats.Swings.Value = player.leaderstats.Swings.Value +250
		player.leaderstats.Swings.Value = player.leaderstats.Swings.Value -250
				end
  			end
		 end
		end)

1 comment

0

LOL da da da

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