If you need more info, ask.
How would I make a premium roblox user have a certain hat in game?
Along with a special gear, and clothes
If you need more info, ask.
How would I make a premium roblox user have a certain hat in game?
Along with a special gear, and clothes
You should use Player.MemebershipType. Read about it here
local Players = game:GetService("Players")
local player = Players.LocalPlayer
if player.MembershipType == Enum.MembershipType.Premium then
-- Take some action specifically for Premium members
end
Firstly, you’d need to actually check if the player has premium. This can be done by doing the following:
game.Players.PlayerAdded:Connect(function(player)
if player.MembershipType == Enum.MembershipType.Premium then
-- do certain things here
end
end)
If you wish for them to have a certain hat, there are a few ways you could go about it. The easiest way is to clone a hat which you have in game and add it to the player. You can use a plugin to insert assets such as hats into the game. I recommend the one linked however you can find others which do the same thing. For this you would do something like:
local hat = game.ServerStorage:WaitForChild("CoolHat")
game.Players.PlayerAdded:Connect(function(player)
if player.MembershipType == Enum.MembershipType.Premium then
local Character = player.Character
local clonedHat = hat:Clone()
clonedHat.Parent = Character
end
end)
If it’s legitimately a hat on the catalog, it’ll place it on the head of the character automatically without having to manually position it.
Relevant articles:
Hope this helped.
Plugin won’t install, it shows this
any help?
I’m gonna try reinstall studio.
This is a known bug on Roblox Studio and has been reported. When you click install on the website, it adds it to your inventory. This means you can then install the plugin through the Toolbox under the “My Plugins” section.
I tried in studio but nothing happened, this is my script
local hat = game.ServerStorage:WaitForChild(“DominoCrown”)
local Players = game:GetService(“Players”)
local player = Players.LocalPlayer
if player.MembershipType == Enum.MembershipType.Premium then
game.Players.PlayerAdded:Connect(function(player)
if player.MembershipType == Enum.MembershipType.Premium then
local Character = player.Character
local clonedHat = hat:Clone()
clonedHat.Parent = Character
end
end)
end
Please put your code in a code block by putting 3 backticks at the beginning and end. Is this a server or client script? You are referencing ServerStorage and LocalPlayer which they are only accessible on the server and client respectively.
Sorry, I am new to devforum
This is a server script inside of serverscriptservicez
local hat = game.ServerStorage:WaitForChild(“DominoCrown”)
local Players = game:GetService(“Players”)
Players.PlayerAdded:Connect(function(player)
if player.MembershipType == Enum.MembershipType.Premium then
local Character = player.Character
local clonedHat = hat:Clone()
clonedHat.Parent = Character
end
end)
This should work.
Nope, just plain, any other solutions?
I will try put this script in a seperate game to checkif there is something wrong in my game
Nope, there is also no errors in the output
Humanoid:addaccessory(hat)
Maybe and is it local
try doing characteradded before adding the hat, like this:
local hat = game.ServerStorage:WaitForChild(“DominoCrown”)
local Players = game:GetService(“Players”)
Players.PlayerAdded:Connect(function(player)
if player.MembershipType == Enum.MembershipType.Premium then
player.CharacterAdded:Connect(function(Character)
local clonedHat = hat:Clone()
clonedHat.Parent = Character
end
end
end)
Still not working. Any other suggestions?