-
What do you want to achieve?
I currently working on ice magic to my fighting game -
What is the issue?
The issue is that touched is not a valid member of Serverscriptservice
- What solutions have you tried so far?
I trying to figuring this myself but had no idea.
Here’s the script:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Parent then
if hit.Parent.Name == script.Player.Value or hit.Parent.Parent.Name == script.Player.Value then return end
script.Disabled = true
hit.Parent.Humanoid:TakeDamage(script.DamageTaken.Value)
local folder = workspace:FindFirstChild("DebrisFolder") or Instance.new("Folder",workspace)
folder.Name = "DebrisFolder"
local function effect()
local bolt = Instance.new("Part",folder)
bolt.Name = "Effect"
bolt.BrickColor = BrickColor.new("Maroon")
bolt.Material = "Neon"
bolt.Transparency = 0
bolt.Size = Vector3.new(0.2,0.2,0.2)
bolt.CanCollide = false
bolt.Anchored = false
bolt.CFrame = hit.CFrame
local Movement = Instance.new("BodyVelocity", bolt)
Movement.Velocity = Vector3.new(math.random(-30,30), math.random(-30,30), math.random(-30,30))
Movement.P = math.random(10,20)
game.Debris.AddItem(bolt,1)
end
for i = 1,50 do
effect()
end
end
end)
is there any solution to fix this? if it is, please answer me.