Premium benefits problem

This script spits out an error, and I am unsure if it is because I’m not premium, or if it is because I messed something up in my script?

local players = game:GetService("Players")

players.PlayerAdded:connect(function(player)
	if player.MembershipType == Enum.MembershipType.Premium then
		
		script.Child:Clone().Child = game.Workspace.Characters --Move "DUMB" (wip name) into Characters folder so they can appear.
		
			end
		end)
	end
end)

Error:
image

The intended behavior for my script is to have a character appear in my game when a premium player joins; preferably organizing itself into being in the “Characters” folder.

(“Dumb” is a beta name, and will not be the final name for the character)

Here’s the game where it will take effect in, by the way:
https://www.roblox.com/games/6779681235/Alpha

is there more code than what is displayed here, or is that all?

1 Like

it is because there are too much ends

1 Like

The code displayed is all that I have for my script.

local players = game:GetService("Players")

players.PlayerAdded:connect(function(player)
	if player.MembershipType == Enum.MembershipType.Premium then
		
		script.Child:Clone().Child = game.Workspace.Characters --Move "DUMB" (wip name) into Characters folder so they can appear.
		
	end
end)

Give this a try. You had too many end statements

2 Likes

delete the last 2 end then it will work right

1 Like