The question might not make sense, but i was wondering, how can a Touched event work with multiple parts, (EX: The player touches one of two parts, but it doesn't double the effect)
I could try with one script, or a few in each part. Either way, it's confusing.
Also, the 'Things' Variable is there to show of what I want the player to touch, but only works once.
Sorry if my question doesn't make any sense. I'm not american.
local things = {script.Parent.Chest.muzzle, script.Parent.Chest.muzzle2,script.Parent.Chest.head}
script.Parent.Chest.muzzle.Touched:connect(function(hit)
local human = hit.Parent:FindFirstChild("Humanoid")
if not human then return end
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if not player then return end
local EnemyLevel = script.Parent.Level.Value/3
local EXPgainReduced = player.EXPtoGain.Value/2
local EXP = EnemyLevel+EXPgainReduced/5
local GUItoAdd = EXP/player.PlayerGui.ScreenGui.Level.Meter.Size.X.Scale
while true do
wait()
if script.Parent.Enemy.Health < 5 then
player.PlayerGui.ScreenGui.Level.Meter.Event:Fire(EXP)
wait(31)
script.Disabled = true
end
end
end)

1 comment
Thank you!