#This event is not working, have tried everything to fix it with Google Gemini
27 messages · Page 1 of 1 (latest)
How this event works?
step1: Clones HEsHEre part (ServerStorage > Entities > HEsHEre)
step2: Put the cloned one into workspace
step3: Teleport to random position (minXpos: -164 maxXpos: 215) (minYpos: 1 maxYpos: 181) (minZpos: -186 maxZpos: 205)
step4: Check if the player stares at it under 6 seconds
step5: If the play doesn't stare at it and 6 seconds is over, the graphics will turn into red then makes kill sound then the player dies and gets kicked with message "DId YOu SEe mE?"
step6: If the player looked at the entity, the game will turn into red for 1 second and sound plays then the entity disappears (delete cloned entity) and graphics turns back to normal.
Is the event firing and not doing anything? Is it doing something but not what you want?
it is launched by EventManager, also i can fire it though developer console
** You are now Level 1! **
all of steps until step 4 works
step 4 to 6 is not working
Are you seeing errors or warnings?
Okay, show me just part 4 code.
the camera detection
while tick() - startTime < 6 do
task.wait(0.1)
local camera = workspace.CurrentCamera
local entityPosition = clonedEntity.Position
local cameraPosition = camera.CFrame.Position
local direction = (entityPosition - cameraPosition).Unit * 10000 --Increased raycast length
local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = {player.Character, clonedEntity}
raycastParams.FilterType = Enum.RaycastFilterType.Exclude
local raycastResult = workspace:Raycast(cameraPosition, direction, raycastParams)
print("Raycast Origin: ", cameraPosition)
print("Raycast Direction: ", direction)
print("Direction X: ", direction.X, "Y: ", direction.Y, "Z: ", direction.Z) -- Print direction components
print("Entity Position: ", entityPosition)
print("Camera Position: ", cameraPosition)
print("Camera LookVector: ", camera.CFrame.LookVector)
if raycastResult then
print("Raycast Hit: ", raycastResult.Instance)
else
print("Raycast Hit: nil")
end
if raycastResult and raycastResult.Instance == clonedEntity then
playerLooked = true
break
end
end
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CameraEffectEvent = ReplicatedStorage:WaitForChild("CameraEffect")
if playerLooked then
-- Player looked at the entity
CameraEffectEvent:FireClient(player)
clonedEntity:Destroy()
else
-- Player did not look at the entity
CameraEffectEvent:FireClient(player)
-- Play kill sound here.
local humanoid = player.Character and player.Character:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health = 0;
end
player:Kick("DId YOu SEe mE?")
clonedEntity:Destroy()
end
should i show you how it behaves? (in vc)
No, the goal is to figure out why it stops here.
Are you absolutely sure that while loop is running? Is it skipping it?
i dont even know, this whole event was coded by google gemini.
when i look at the entity directly, the Raycast hit keeps saying Barrier instead of entity part "HEsHEre"
Oh. That's a problem.
It'll be impossible to help you as you don't even know what you wrote.
You should only use AI if you have enough experience to know what it's giving you.
i told Gemini the problem, also it created 12 events sucessfully without any errors being unfixable
great, i always have lack of support then.
: (
** You are now Level 2! **
AI can be wrong. You cannot trust it. You're in this situation right now because AI was wrong.
You need to learn the fundamentals of Roblox development & programming.
but it seems to be hard to learn because i also have understanding disorder
Unfortunately it's something you have to push through for the love of developing.
I don't have your struggle so I can't give you advice, unfortunately.
but using AI isn't a great plan, as it'll leave you stuck, just like this.
I'm sorry that it's more difficult to learn.
well atleast the AI coded 12 events that work successfully, but coding this kind of event (like HEsHEre event) needs human to do it.