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?
try using PlayerGui:WaitForChild(“framename”)
This is because the script called startingscreen is looking for a screengui called “main” and “mouseframe” can you send a screenshot of your startergui?
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.
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.
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
Are you trying to make a custom mouse cursor?
local player = game. Players.LocalPlayer
local mouse = player:GetMouse()
mouse.Icon = “rbxassetid://MOUSEICONID”
If you do know there is a certain type of cursor most horror games use im trying to make that it looks like this
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.
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:
Also my start button is a ui not a keybind so how would i go about that?
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
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)
Sadly it still does not change when i press start
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.
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
Yes, by using the code I gave you, it shouldn’t change the mouse’s icon until you click the UnlockMouse button