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 6 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)

jun = script.Parent.Parent
Stuff = false
--password
function ssj()
if Stuff == false then
Stuff = true
for u, c in pairs (jun.Character:GetChildren()) do
if c.className == "Accessory" and c.Name ~= "Swordpack" and c.Name ~= "GlassesBlackFrame" then
c.Handle.Transparency = 1
end
end
Hair23 = Instance.new("Part")
Hair23.Parent = jun.Character
Hair23.Name = "Hair"
Hair23.formFactor = "Symmetric"
Hair23.Size = Vector3.new(1, 1, 1)
Hair23.CFrame = jun.Character.Head.CFrame
Hair23:BreakJoints()
Hair23.CanCollide = false
Hair23.TopSurface = "Smooth"
Hair23.BottomSurface = "Smooth"
Hair23.BrickColor = BrickColor.new("Bright yellow")
Weld = Instance.new("Weld") 
Weld.Part0 = jun.Character.Head 
Weld.Part1 = Hair23
Weld.Parent = jun.Character.Head 
Weld.C0 = CFrame.new(0, 0.12, -0.1)*CFrame.fromEulerAnglesXYZ(0, 0, 0) 
Mesh = Instance.new("SpecialMesh")
Mesh.Parent = Hair23
Mesh.MeshId = "http://www.roblox.com/asset/?id=74868480"
Mesh.Scale = Vector3.new(1, 1, 1)
Hair22 = Instance.new("Part")
Hair22.Parent = jun.Character
Hair22.Name = "Hair"
Hair22.formFactor = "Symmetric"
Hair22.Size = Vector3.new(1, 1, 1)
Hair22.CFrame = jun.Character.Head.CFrame
Hair22:BreakJoints()
Hair22.CanCollide = false
Hair22.TopSurface = "Smooth"
Hair22.BottomSurface = "Smooth"
Hair22.BrickColor = BrickColor.new("Bright yellow")
Weld = Instance.new("Weld") 
Weld.Part0 = jun.Character.Head 
Weld.Part1 = Hair22
Weld.Parent = jun.Character.Head 
Weld.C0 = CFrame.new(0, 0.5, 0.1)*CFrame.fromEulerAnglesXYZ(0, 0, 0) 
Mesh = Instance.new("SpecialMesh")
Mesh.Parent = Hair22
Mesh.MeshId = "http://www.roblox.com/asset/?id=19326912"
Mesh.Scale = Vector3.new(1, 1, 1)
Hair4 = Instance.new("Part")
Hair4.Parent = jun.Character
Hair4.Name = "Hair"
Hair4.CanCollide = false
Hair4.Locked = true
Hair4.TopSurface = "Smooth"
Hair4.BottomSurface = "Smooth"
Hair4.formFactor = "Symmetric"
Hair4.BrickColor = BrickColor.new("Bright yellow")
Hair4.CFrame = jun.Character.Torso.CFrame
Hair4.Size = Vector3.new(1, 1, 1)
Weld = Instance.new("Weld")
Weld.Parent = jun.Character.Head
Weld.Part0 = jun.Character.Head
Weld.Part1 = Hair4
Weld.C0 = CFrame.new(0, 1.3, 0)
Mesh = Instance.new("SpecialMesh")
Mesh.Parent = Hair4
Mesh.Scale = Vector3.new(0.7, 0.9, 0.7)
Mesh.MeshType = "FileMesh"
Mesh.MeshId = "http://www.roblox.com/asset/?id=430344159"
     Effect = Instance.new("Part")
     Effect.Parent = jun.Character
     Effect.Anchored = true
     Effect.CanCollide = false
     Effect.Size = Vector3.new(1, 1, 1)
     Effect.formFactor = "Symmetric"
     Effect.Transparency = 0.5
     Effect.BrickColor = BrickColor.new("White")
     Effect.TopSurface = "Smooth"
     Effect.BottomSurface = "Smooth"
     EffectMesh = Instance.new("CylinderMesh")
     EffectMesh.Parent = Effect
     EffectMesh.Scale = Vector3.new(1, 1500, 1)
--[[ex = Instance.new("Explosion")
ex.Position = jun.Character.Torso.Position
ex.BlastPressure = 0
ex.Parent = workspace]]
     jun.Character.Torso.CFrame = jun.Character.Torso.CFrame * CFrame.new(0, 0.1, 0)
     for i = 1 , 20 do
      Effect.CFrame = CFrame.new(jun.Character.Torso.Position)
      EffectMesh.Scale = EffectMesh.Scale + Vector3.new(2, 0, 2)
      Effect.Transparency = Effect.Transparency + 0.025
      wait(0.06)
     end
Effect:Remove()
if jun.Character.Torso:findFirstChild("PwnFire") == nil then
pie = Instance.new("Fire")
pie.Name = "PwnFire"
pie.Parent = jun.Character.Torso
pie.Size = 9
pie.Color = BrickColor.new("Bright yellow").Color
pie.SecondaryColor = BrickColor.new("White").Color
pie.SecindarySize = 8
end
jun.PlayerGui.Bars.MaxKi.Value = 550
wait(0.3)
end
end
function nossj()
if Stuff == true then
Stuff = false
if jun.Character.Torso:findFirstChild("PwnFire") ~= nil then
jun.Character.Torso:findFirstChild("PwnFire"):Remove()
end
     p = Instance.new("Part")
     p.Parent = jun.Character
     p.Anchored = true
     p.CanCollide = false
     p.Transparency = 0.1
     p.formFactor = "Symmetric"
     p.Size = Vector3.new(22, 22, 22)
     p.TopSurface = "Smooth"
     p.BottomSurface = "Smooth"
     p.Name = "Sharingan"
     p.Shape = "Ball"
     p.CFrame = jun.Character.Torso.CFrame
     p.BrickColor = BrickColor.new("Bright yellow","White")
     for i = 1 , 10 do
      wait(0.05)
      p.Size = p.Size + Vector3.new(-4, -4, -4)
      p.Transparency = p.Transparency + 0.1
      p.CFrame = jun.Character.Torso.CFrame
     end
p:Remove()
for u, c in pairs (jun.Character:GetChildren()) do
if c.className == "Accessory" and c.Name ~= "Swordpack" and c.Name ~= "GlassesBlackFrame" then
c.Handle.Transparency = 0
end
if c.Name == "Hair" then
c:Remove()
end
end
jun.PlayerGui.Bars.MaxKi.Value = 500
end
end
jun.Chatted:connect(function(Msg)
 msg = Msg:lower()
 if string.sub(msg, 1, 7) == "supersaiyan" then
 wait(0.1)
  ssj()
 wait(110)
  nossj()
 end
 if string.sub(msg, 1, 13) == "ssj" then
 wait(0.1)
  ssj()
 wait(110)
  nossj()
 end
 if string.sub(msg, 1, 6) == "!" then
 wait(0.1)
  ssj()
 wait(110)
  nossj()
 end
 if string.sub(msg, 1, 10) == "calm" then
 wait(0.1)
  nossj()
 end
 if string.sub(msg, 1, 3) == "off" then
 wait(0.1)
  nossj()
 end
end)
function OnDeath()
wait()
nossj()
end
jun.Character.Humanoid.Died:connect(OnDeath)
jun = script.Parent.Parent
Stuff = false
--mediafire---
1
line 105, Secondary is spelled Secindary camxd01 48 — 6y
0
Ty IIApexGamerII 76 — 6y

1 answer

Log in to vote
1
Answered by
DanzLua 2879 Moderation Voter Community Moderator
6 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

player.Chatted:connect(function(msg)

end)

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

player.Chatted:connect(function(msg)
    if msg=="SSJ" then
        ssh()
    end
end)

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

Ad

Answer this question