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

why are no scripts working inside my projectiles?

Asked by 1 year ago
local Tear = game.ReplicatedStorage:WaitForChild("tear")
local plr = game.Players.LocalPlayer

local UserInputService = game:GetService("UserInputService")

local speed = 110

UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
    if not gameProcessedEvent then -- if player is not typing
        if input.KeyCode == Enum.KeyCode.E then
            local char = plr.Character
            if not char or not char.Parent then -- if player's character hasn't loaded
                char = plr.CharacterAdded:Wait()

            local tearclone = Tear:Clone()
            tearclone.Parent = workspace

            tearclone.CanCollide = true
            tearclone.Anchored = false
            tearclone.CFrame = char.Head.CFrame + char.Head.CFrame.LookVector

            tearclone.AssemblyLinearVelocity = tearclone.CFrame.LookVector * speed

theres a custom body velocity in the projectile too. when i try to put a damage script in the projectile, the script doesnt work. if i check the projectiles, i can see that the damage script is indeed in them but toesnt work for some reason. i dont want to modify the script above, it would be better in i could script the projectile instead.

Can you try using print("test") to narrow in on the problem so we know what line is breaking?? theking66hayday 841 — 1y
ill try pakancina 19 — 1y
i modified the script above to print "works" and it does work, i don't know what to put in the projectile but i tried just print("works2") and it does not work. pakancina 19 — 1y

Answer this question