script.Parent.MouseButton1Click:Connect(function() game.StarterPlayer.Noob.Name = "StarterPlayer" game.Players.LocalPlayer.Humanoid.Health = 0 end)
i want a system if a player has a gamepass he can morph into a noob via a gui i also need help cuz i dont know how to define humanoid to kill the play
This script would require two scripts. One to detect the mouse click and fire an event. The other to respond to said event and do the morphing.
For the event just make a folder in game.ReplicatedStorage call it whatever you want. Inside of that out a remote event and call that whatever you want. For this example the folder will be called "Remotes" and the remote event called "Morph"
For the local script you need to fire the event when the button is pressed. Using a local script inside of the button:
local RepStore = game:GetService("ReplicatedStorage") local Event = RepStore.Remotes.Morph script.Parent.MouseButton1Click:Connect(funtion() Event:FireServer() end)
For the server sided script you need to check for the game pass then morph is the player owns the gamepass:
local RepStore = game:GetService("ReplicatedStorage") local Event = RepStore.Remotes.Morph local Market = game:GetService("MarketplaceService") local function morph(player) if Market:UserOwnsGamePassAsync(player.UserId, PassIdHere) then local char = player.Character if char then local hum = char:WaitForChild("Humanoid") if hum.Health > 0 then for i, v in pairs(char:GetChildren()) do if v:IsA("Accessory") then v:Destory() end end local bodycolors = char:FindFirstChild("BodyColors") if bodycolors then --put script here end end end end end Event.OnServerEvent:Connect(morph)
I don't know the body color stuff off by heart so your gonna have to do that bit yourself but you can use Color3.fromRGB(R,G,B) and set it to each noob color for each body part. That's how you do it.
Hope this helps you