Hi there everyone, hope I can get the right help with this one.
I’m having troubles how I’ll start moving a step above this coding because I got code-blocked… I don’t know how to detect players that are already in this area receive only the announcement
this script creates a Block that expands in the Player’s HumanoidRootPart that announced it. And I got lost at this part on how that new Instance will detect players inside of it to send the announcement…
okay apparently, the touched event isn’t working… What is it called that detects players inside it?? I forgot… can someone help me out. Was it renderstepped?
oh mb… I felt dumb after doing that… tho- should I use the Event PlayerEntered in the ZonePlus Module? or is there a different way of detecting for the code to go through?
Is the player spawning in the part? Is the part spawning where the player is? Im not sure if the zone module sends the event when it spawns and detects the player. But you shouldnt worry about it if the player doesnt spawn in it or the part doesnt spawn on the the player. In such cases you should either do a loop checking the player entered array or when you spawn it in you check if there are players in and if not then continue as intended. (For optimization, you should make it event wise and not loops. Since that would take memory, making your script slower)
Tl;dr if the player isnt spawning in the part or the other way around, youre good.
local newZone = ZonePlus.new(newInstance) -- this creates a new part inside the HumanoidRootPart of the Player that sent the announcement
newZone.PlayerEntered:Connect(function(player: plr) -- this is the Line 65
print("players in zone, Sending Announcement.")
TweenService:Create(Clone, Info, {Position = UDim2.fromScale(0, 0)}):Play()
TweenService:Create(Clone, Info, {Size = UDim2.fromScale(1, 1)}):Play()
TweenService:Create(ImageLabel, Info, {ImageTransparency = 0}):Play()
Sound:Play()
repeat
cd.Text = Timer
wait(1)
Timer -= 1
until Timer <= 0
cd.Text = "0"
wait(Timer)
TweenService:Create(Clone, Info2, {Position = UDim2.fromScale(0.5, 0.5)}):Play()
TweenService:Create(Clone, Info2, {Size = UDim2.fromScale(0, 0)}):Play()
TweenService:Create(ImageLabel, Info2, {ImageTransparency = 1}):Play()
wait(1)
Clone_1:Destroy()
end)
yes it creates a block instance before the actual event happens.