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

I converted my script into FE and worked, but the problem is, Player:GetMouse() does not work?

Asked by 5 years ago

So I used RemoteEvent and still don't know used it until it just acts like how RemoteFunction does, it must be in a separate code but I got an error to local mouse. I got an error that it said local mouse is a nil value but I put it in a code, now I have many local mouse's but still not working. I can see the blast in Server now so players do see my blast too. This is the part the separate code got an error.

    local u = game:GetService("UserInputService")

local remote = game:GetService("ReplicatedStorage").Spell1

local t = game:GetService("TweenService")

local player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()

local mouse = player:GetMouse()

local character = player.Character or player.CharacterAdded:Wait()

local human = character:FindFirstChild("Humanoid") or character:WaitForChild("Humanoid")

local cooldown = true

local cooldown2 = true --don't use it for other line of codes

local animationid = "rbxassetid://02759884771"

local animationid2 = "rbxassetid://02782434221"

local animationid3 = "rbxassetid://02876134786"

local animate

local onlyhuma

local chat = game:FindFirstChild("Chat")

local explosionlimit = 1

local get

local explosiondamage = false

local activate = false



remote.OnServerEvent:Connect(function(player, mouse)

local animation = Instance.new("Animation")

animation.AnimationId = animationid

animation.Parent = character

character:FindFirstChild("Humanoid").WalkSpeed = 0

character:FindFirstChild("Humanoid").JumpPower = 0



character:FindFirstChild("HumanoidRootPart").Anchored = true

local symbol = game:GetService("ReplicatedStorage").dontdisturbthis.PainMagicFiles.PainSymbol:Clone()

symbol.Parent = game.Workspace

symbol.CFrame = character:FindFirstChild("HumanoidRootPart").CFrame * CFrame.new(0,-3,0)



local aol = {}

aol.Size = Vector3.new(12, 0.05, 12)

aol.Orientation = Vector3.new(0,character:FindFirstChild("HumanoidRootPart").Orientation.Y,0)

local a1 = t:Create(symbol, TweenInfo.new(0.5), aol)

a1:Play()

local pain = game:GetService("ReplicatedStorage").dontdisturbthis.PainMagicFiles.Blood:Clone()

pain.Parent = game.Workspace

pain.CFrame = character:FindFirstChild("HumanoidRootPart").CFrame * CFrame.new(0,5,0)

pain.Transparency = 1



local trans = {}

trans.Transparency = 0

local t1 = t:Create(pain, TweenInfo.new(0.5), trans)

t1:Play()

local attachment1 = Instance.new("Attachment")

attachment1.Parent = pain

local attachment0 = Instance.new("Attachment")

attachment0.Parent = character:FindFirstChild("HumanoidRootPart")

local beam = game:GetService("ReplicatedStorage").dontdisturbthis.PainMagicFiles.Bloodbeam:Clone()

beam.Parent = pain

beam.Attachment1 = attachment1

beam.Attachment0 = attachment0





wait(1/3 + 1/2 - 0.7)

print(1/3 + 1/2 - 0.7)



animate = human:LoadAnimation(animation)

animate:Play()

wait(0.7)

character:FindFirstChild("Humanoid").WalkSpeed = 16

character:FindFirstChild("Humanoid").JumpPower = 50

character:FindFirstChild("HumanoidRootPart").Anchored = false

wait(0.1)

local goal = {}

goal.CFrame = character:FindFirstChild("HumanoidRootPart").CFrame * CFrame.new(0,24,-45)

local g = t:Create(pain, TweenInfo.new(0.5), goal)

g:Play()

local sound = game.ReplicatedStorage.dontdisturbthis.PainMagicFiles.Launch:Clone()

sound.Parent = pain

sound:Play()



wait(0.2)

animation:Destroy()



local goal2 = {}

goal2.CFrame = CFrame.new(mouse.Hit.p.X,mouse.Hit.p.Y,mouse.Hit.p.Z)

local g2 = t:Create(pain, TweenInfo.new(0.3), goal2)

g2:Play()

pain.Touched:Connect(function(hit)

local hs = hit:FindFirstChild("Humanoid") or hit.Parent:FindFirstChild("Humanoid")

if explosionlimit == 1 then

explosionlimit = 2

print("yay")

local expl = game:GetService("ReplicatedStorage").dontdisturbthis.PainMagicFiles.PainExplode:Clone()

expl.Parent = workspace

expl.CFrame = pain.CFrame * CFrame.new(0,-0.5, 0)

--[[ expl.Touched:Connect(function(hit)

local hs = hit:FindFirstChild("Humanoid") or hit:FindFirstChildOfClass("Humanoid")

if hs then

hs.PlatformStand = true

hs:TakeDamage(10)

wait(5)

hs.PlatformStand = false

end

end)

--]]





local sound = game.ReplicatedStorage.dontdisturbthis.PainMagicFiles.Hit:Clone()

sound.Parent = expl

sound:Play()



local go = {}

go.Size = Vector3.new(50,2,50)

local g1g = t:Create(expl, TweenInfo.new(1), go)

g1g:Play()





pain:Destroy()

wait(0.2)

local monster = game.ReplicatedStorage.dontdisturbthis.PainMagicFiles.BloodMonster:Clone()

monster.Parent = game.Workspace

monster.Name = "" --blank

monster:SetPrimaryPartCFrame(CFrame.new(expl.CFrame.X, expl.CFrame.Y + 5, expl.CFrame.Z))

local animation = Instance.new("Animation")

animation.Parent = monster

animation.AnimationId = animationid3

onlyhuma = monster:FindFirstChild("Humanoid"):LoadAnimation(animation)

onlyhuma:Play()

wait(0.8)

local shock = game.ReplicatedStorage.dontdisturbthis.PainMagicFiles.Shockwave:Clone()

shock.Parent = workspace

shock.CFrame = monster.HumanoidRootPart.CFrame * CFrame.new(0,0,0)

local goa = {}

goa.Transparency = 1

local yay = t:Create(shock, TweenInfo.new(0.8), goa)

yay:Play()

local asfa = {}

asfa.Scale = Vector3.new(70,1,70)

local fwhat = t:Create(shock.Mesh, TweenInfo.new(0.8), asfa)

fwhat:Play()

local splash = game.ReplicatedStorage.dontdisturbthis.PainMagicFiles.Splash:Clone()

splash.Parent = expl

splash:Play()





explosionlimit = 1

local yay = {}

yay.Size = Vector3.new(70,1,70)

local whar = t:Create(expl, TweenInfo.new(0.5), yay)

whar:Play()

local invi = {}

invi.Transparency = 1

wait(0.5)

local a = TweenInfo.new(1)

shock:Destroy()



local whatsa = t:Create(monster.Head, a, invi)

local whatsa1 = t:Create(monster["Left Arm"], a, invi)

local whatsa2 = t:Create(monster["Right Arm"], a, invi)

local whatsa3 = t:Create(monster["Right Leg"], a, invi)

local whatsa4 = t:Create(monster["Left Leg"], a, invi)

local whatsa5 = t:Create(monster.Torso, a, invi)

local whatsa6 = t:Create(monster.Horns, a, invi)

local whatsa7 = t:Create(monster.Torso.Rib, a, invi)

whatsa:Play()

whatsa1:Play()

whatsa2:Play()

whatsa3:Play()

whatsa4:Play()

whatsa5:Play()

whatsa6:Play()

whatsa7:Play()

wait(1.6)

monster:Destroy()



wait(4)

local nooo = {}

nooo.Size = Vector3.new(0,0,0)

local abuse = t:Create(expl, TweenInfo.new(0.5), nooo)

abuse:Play()

wait(0.5)

expl:Destroy()

--if -- then

--end

end

end)

pain.Anchored = false

wait(1)

pain:Destroy()

local symb = {}

symb.Size = Vector3.new(0.05,0.05,0.05)



local sy1 = t:Create(symbol, TweenInfo.new(0.2), symb)

sy1:Play()

wait(1)

symbol:Destroy()

end)
0
You can't get the players mouse without using a local script fire a remote event that has the pos of the players mouse that was in the local script over DogCooper 2 — 5y

Answer this question