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

How to make a player transform upon saying a word?

Asked by 7 years ago

So what I did was I tried making a SSJ script, the purpose of it is to transform your Roblox Character into this super saiyan with powers. It is suppose to change the Player's Shirt, Pants, and Accessories. Basically everytime I say "SSJ" it is not allowing players to transform. Any advice anyone? (Yes this is a previous one)

001jun = script.Parent.Parent
002Stuff = false
003--password
004function ssj()
005if Stuff == false then
006Stuff = true
007for u, c in pairs (jun.Character:GetChildren()) do
008if c.className == "Accessory" and c.Name ~= "Swordpack" and c.Name ~= "GlassesBlackFrame" then
009c.Handle.Transparency = 1
010end
011end
012Hair23 = Instance.new("Part")
013Hair23.Parent = jun.Character
014Hair23.Name = "Hair"
015Hair23.formFactor = "Symmetric"
View all 184 lines...
1
line 105, Secondary is spelled Secindary camxd01 48 — 7y
0
Ty IIApexGamerII 76 — 7y

1 answer

Log in to vote
1
Answered by
DanzLua 2879 Moderation Voter Community Moderator
7 years ago

We can use the Chatted event of player to fire a function if the message that he sent is that word

First let's setup the event, make sure that you setup a player variable

1player.Chatted:connect(function(msg)
2 
3end)

Next let's check that the msg is that keyword and fire the function if it is

1player.Chatted:connect(function(msg)
2    if msg=="SSJ" then
3        ssh()
4    end
5end)

Make sure you put this event at the bottom of the script so that the function is already defined

Ad

Answer this question