i have a serversided bindableevent that returns a part and another script that checks if the part still exists after an amount of time has passed.
heres the script that creates and returns the part:
game.ReplicatedStorage.ServerHitbox.Event:Connect(function(part,size,player)
local weld = Instance.new("Weld")
local Hitbox = script.Hitbox:Clone()
weld.Parent = Hitbox
Hitbox.CFrame = part.CFrame
Hitbox.Size = size
weld.Part0 = Hitbox
weld.Part1 = part
Hitbox.Parent = workspace.Hitboxes
Hitbox:SetAttribute("IsServersided",true)
Hitbox:SetAttribute("Owner",player.Name)
return Hitbox
end)
and heres the script that checks if the part is still existing:
local Hitbox = game.ReplicatedStorage.ServerHitbox:Fire(Player.Character[animFolder.C1.Hitbox.Value],Vector3.new(5,5,5),Player)
if Hitbox == nil then
Player.Character.Combo.Value += 1
else
Hitbox:Destroy()
end
the Hitbox
value returns as nil even though the object is clearly visible in the hitbox folder
help would be appreciated!!!