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

Work in studio but not in play mode ? [ANSWERED]

Asked by 8 years ago

I made a "tool" with no handle to do multiples actions and it took me days to make it and doesn't work in play mode..

Press "Q" to crawl on ceilling----

local tool = script.Parent.Parent:WaitForChild("XenoAttack")
local mouse = tool.Parent.Parent:GetMouse()
wait (0.3)
player = tool.Parent
script.Parent.BodyVelocity.Parent = player.Torso
local V = player.Torso.BodyVelocity
local Debounce = false

function ball(key)
    if (key == "q") then
        if player.Torso.BodyVelocity.Velocity == Vector3.new(V.Velocity.X, 0, V.Velocity.Z) then
            if Debounce == true then return end
               player.Animate.fall.FallAnim.AnimationId = ("http://www.roblox.com/asset/?id=360084380")
               player.Torso.BodyVelocity.MaxForce = Vector3.new(V.MaxForce.X, 17000, V.MaxForce.Z)
               Debounce = true
               player.Torso.BodyVelocity.Velocity = Vector3.new(V.Velocity.X, 120, V.Velocity.Z)
               wait (3)
               Debounce = false

        else
        if player.Torso.BodyVelocity.Velocity == Vector3.new(V.Velocity.X, 120, V.Velocity.Z) then
            if Debounce == true then return end
               player.Animate.fall.FallAnim.AnimationId = ("http://www.roblox.com/asset/?id=180436148")
               player.Torso.BodyVelocity.MaxForce = Vector3.new(V.MaxForce.X, 0, V.MaxForce.Z)
               Debounce = true
               player.Torso.BodyVelocity.Velocity = Vector3.new(V.Velocity.X, 0, V.Velocity.Z)
               wait (3)
               Debounce = false
        end
        end
    end
end

mouse.KeyDown:connect(ball)

And click to attack--

local tool = script.Parent.Parent:WaitForChild("XenoAttack")
local mouse = tool.Parent.Parent:GetMouse()
wait (0.1)
tool.Parent = script.Parent.Parent.Parent.Character
wait (0.1)
player = tool.Parent
script.Parent.Configuration.Attack:Clone().Parent = player.Humanoid
local DC = false
script.Parent.Configuration.Sounds:Clone().Parent = player.Torso


mouse.Button1Down:connect(function(Duder)
     if DC == true then return end
     DC = true
     local AnimTrack = player.Humanoid:LoadAnimation(player.Humanoid.Attack)
     AnimTrack:Play()
     local Sounds = player.Torso.Sounds:GetChildren()
     local Sound = Sounds[math.random(1,#Sounds)]
     Sound:Play()
     wait (0.8)
     DC = false
end)

and press shift to crawl/run --

local tool = script.Parent.Parent:WaitForChild("XenoAttack")
local mouse = tool.Parent.Parent:GetMouse()
wait (0.3)
player = tool.Parent
local Debounce = false
player.Animate.jump.JumpAnim.AnimationId = ("http://www.roblox.com/asset/?id=227475867")
player.Animate.walk.WalkAnim.AnimationId = ("http://www.roblox.com/asset/?id=360057921")
script.DamageScript:Clone().Parent = player:FindFirstChild("Right Arm")
script.DamageScript:Clone().Parent = player:FindFirstChild("Left Arm")
player:FindFirstChild("Left Arm").DamageScript.Disabled = false
player:FindFirstChild("Right Arm").DamageScript.Disabled = false

 mouse.KeyDown:connect(function(key)
    if key:byte() == 48 then
    player.Humanoid.WalkSpeed = 0
    player.Animate.walk.WalkAnim.AnimationId = ("http://www.roblox.com/asset/?id=227469378")
    wait (0.2)
    player.Humanoid.WalkSpeed = 18
    end
end)

mouse.KeyUp:connect(function(key)
    if key:byte() == 48 then
        player.Humanoid.WalkSpeed = 0
        player.Animate.walk.WalkAnim.AnimationId = ("http://www.roblox.com/asset/?id=360057921")
        wait (0.3)
        player.Humanoid.WalkSpeed = 14
    end
end)

and nothing works in play mode, but works perfectly in studio. Can someone please tell me what is wrong with my scripts ? Thanks for your help !

0
What's the status of your FilteringEnabled? PlsNoDiscrimination 0 — 8y
0
Set to true. haloelite27 25 — 8y
0
And scripts are all server scripts. haloelite27 25 — 8y
0
That's 1 problem. Any script within the character, and FE is true, must be a LocalScript. Shawnyg 4330 — 8y
View all comments (2 more)
0
Even in a tool? haloelite27 25 — 8y
0
Omg thank you so much ! Now it works ! :D haloelite27 25 — 8y

Answer this question