So I have two scripts, one being in StarterPack which is a local script, and one in workspace. I'm trying to make a meteor that drops from the sky and then creates smoke on impact. Local Script:
Player = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")
local part = script.Parent
local Character = Player.Character or Player.CharacterAdded:Wait()
Mouse = Player:GetMouse()
Enabled = true
UIS.InputBegan:connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.E then
game.ReplicatedStorage.RemoteEvent:FireServer(Character.Head.CFrame * CFrame.new(0,0,0))
local Meteor = Instance.new("Part")
Meteor.Shape = Enum.PartType.Ball
Meteor.Size = Vector3.new(100,100,100)
Meteor.BrickColor = BrickColor.new("Really red")
Meteor.Parent = Character
Meteor.CFrame = Character.Head.CFrame*CFrame.new(0,300,0)
Meteor.CanCollide = false
local physProperties = PhysicalProperties.new(0.3,0.1,0,1,100)
Meteor.CustomPhysicalProperties = physProperties
end
end)
Script:
game.ReplicatedStorage.RemoteEvent.OnServerEvent:connect(function(player,location)
print("Event fired")
local effect = Instance.new("Smoke", player.Character.Head)
Instance.new("ParticleEmitter", game.Workspace)
effect.Parent:findFirstChild("Smoke")
game.Workspace.ParticleEmitter.LockedToPart = false
wait(3)
effect.Size = 100
local enabled = false
local enabled = false
local enabled = false
end)
The problem is that when I execute this and press E, the meteor drops and everything, except on impact, more smoke is created with different particles and just stays there. I'm trying to make the smoke disappear after impact. Thanks.
