Selecting a block and a Box appears on it

its local heres the error:

Players.MyName.PlayerGui.LocalScript:6: attempt to index nil with 'GetMouse'

fixed with

local players = game:GetService("Players")
local LocalPlayer = players.LocalPlayer

instead of yours

Oh.

Oh.

local LocalPlayer = game:GetService("Players").LocalPLayer

Oh, my bad.

1 Like

how do i detect a block from Collectionservice from there?

We will be using CollectionService:GetTagged() then we will save this as a variable as I assume you wont update it.

local TaggedArray = CollectionService:GetTagged("WhateverYourTagIs")

Now if we want to check if the target is tagged do:

-- make sure to check that the player's mouse isn't aimed at the void.
if target and table.find(TaggedArray, target) then
   ...
end

thats great thank you so much
will both work fine with what @Ovibion and you provided

for the offset on the gui how do i change it so it begins at the bottom right corner

If you are using a TextLabel inside a ScreenGui and you are setting the Position to the mouse X and Y then make sure the AnchorPoint is set to 1,1 for the right bottom corner.

If I am correct 0,0 for the left top
1,0 for the right top
0,1 for the left bottom.


sorry for the quality i had to down size to show

is this fine
@KJry_s

That looks great! Good job man.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.