Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

A. how to fix this morph gui b. how to add a gamepass?

Asked by
hokyboy 270 Moderation Voter
6 years ago
Edited 6 years ago
1script.Parent.MouseButton1Click:Connect(function()
2    game.StarterPlayer.Noob.Name = "StarterPlayer"
3    game.Players.LocalPlayer.Humanoid.Health = 0
4end)

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

0
First of all your gonna wanna format your script. So I can actually look at it properly Protogen_Dev 268 — 6y
0
sorry i forgot Xxd hokyboy 270 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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:

1local RepStore = game:GetService("ReplicatedStorage")
2local Event = RepStore.Remotes.Morph
3 
4script.Parent.MouseButton1Click:Connect(funtion()
5    Event:FireServer()
6end)

For the server sided script you need to check for the game pass then morph is the player owns the gamepass:

01local RepStore = game:GetService("ReplicatedStorage")
02local Event = RepStore.Remotes.Morph
03local Market = game:GetService("MarketplaceService")
04 
05local function morph(player)
06    if Market:UserOwnsGamePassAsync(player.UserId, PassIdHere) then
07        local char = player.Character
08        if char then
09            local hum = char:WaitForChild("Humanoid")
10            if hum.Health > 0 then
11                for i, v in pairs(char:GetChildren()) do
12                    if v:IsA("Accessory") then
13                        v:Destory()
14                    end
15                end
View all 25 lines...

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

0
I dont get if fully can i add you on team creates? hokyboy 270 — 6y
0
Sure but I won't be able to do anything till my Internet is back up Protogen_Dev 268 — 6y
0
I sent you friend request hokyboy 270 — 6y
0
i have to go man maybe tommrow hokyboy 270 — 6y
0
Ye I'll accept it when I have Internet Protogen_Dev 268 — 6y
Ad

Answer this question