Errors I can not fix

Hi, I am currently making a horror game and I came across an error that appears every time I click i have tried to fix it but I just can’t do it does anybody have an idea on how to fix it?

1 Like

try using PlayerGui:WaitForChild(“framename”)

1 Like

This is because the script called startingscreen is looking for a screengui called “main” and “mouseframe” can you send a screenshot of your startergui?

1 Like

The elements MouseFrame and Main are being “requested” by the script before they even load in. You need a WaitForChild() to wait until they spawn in.

1 Like

The problem I am having is I am trying to make the circle like cursor of a horror game the cursor appears after and stays when I click on one of the notes i made but if I don’t click on a note, it does not. appear.

1 Like

This is the code i have in place


1 Like

The Cursor i want to apear only apears when i click on notes

local originalpos = UDim2.new(0.5, 0,0.5, 0)
local originalsize = UDim2.new(0, 0,0, 0)

local targetpos = UDim2.new(0.5, -45,0.5, -45)
local targetsize = UDim2.new(0, 90,0, 90)

local tweenservice = game:GetService("TweenService")

while true do
	wait()
	
	local newimage = script.ImageLabel:Clone()
	newimage.Parent = script.Parent
	
	local goal1 = {}
	goal1.Size = targetsize
	goal1.Position = targetpos
	
	local tI = TweenInfo.new(0.75, Enum.EasingStyle.Quint)
	
	tweenservice:Create(newimage, tI, goal1):Play()
	
	wait(0.75)
	
	local goal2 = {}
	goal2.ImageTransparency = 1
	
	tweenservice:Create(newimage, tI, goal2):Play()
	
	wait(0.75)
	
	game:GetService("Debris"):AddItem(newimage, 1)
end
1 Like

Are you trying to make a custom mouse cursor?

local player = game. Players.LocalPlayer
local mouse = player:GetMouse()

mouse.Icon = “rbxassetid://MOUSEICONID”
1 Like

If you do know there is a certain type of cursor most horror games use im trying to make that it looks like this

1 Like

Basically I have notes in the game the cursor is supposed to activate when i press the start button on the menu screen but it only apears after i touch a note.

1 Like

local player = game. Players.LocalPlayer
local mouse = player:GetMouse()

(Whatever your start button is).MouseButton1Click:Connect(function()
   mouse.Icon = “rbxassetid://MOUSEICONID”
end)

This should make a custom horror game cursor, you just need to replace the mouseiconid part with the id of the image you want to use for your mouse (in this case, a small white circle)

Here is one i made with the script above:

1 Like

Also my start button is a ui not a keybind so how would i go about that?

1 Like

If your start button is a ui (like a textbutton), the script above should work, just do textbutton.MouseButton1Click to test if it is clicked

1 Like

image

1 Like

Assuming that the unlockmouse button is the start button, you would use


local player = game. Players.LocalPlayer
local mouse = player:GetMouse()

script.openingscene.unlockmouse.MouseButton1Click:Connect(function()
   mouse.Icon = “rbxassetid://MOUSEICONID”
end)

1 Like

image

1 Like

Sadly it still does not change when i press start

1 Like

Is your mouse icon an image?

Here was my mouse icon:

mouse.Icon = “http://www.roblox.com/asset/?id=569021388”

I am thinking maybe you can change the 9 letters at the end to yours? Just a suggestion.

1 Like

On this screen i want it to have a normal Cursor


But i want the cursor to change to a dot when i click that is there a way i can tell it when to change

1 Like

Yes, by using the code I gave you, it shouldn’t change the mouse’s icon until you click the UnlockMouse button

1 Like