Help With Exp When You Touch a Part

@Kamlkaze_Kid

Don’t use the second argument for Instance.new(), there was a thread in 2016
that addressed this.

Second,

what is the purpose of this empty while loop??

Try to use descriptive variables so that it is easy to catch errors, instead of defining a folder as x, define it as leaderstats = etc.

Do not attempt to use Lighting for storing instances, this usage is legacy like and use either ReplicatedStorage or ServerStorage to store items instead .

This code is outside the function bound to the PlayerAdded event, it would error if workspace.BlckLndsEndZne did not exist.

Make sure this is a script then, local scripts can’t access ServerScriptService as it’s contents are not replicated.

Also you are attempting to add an instance to 25, you meant to do something like this instead:

   local exp = something.Points
   exp.Value = exp.Value + 25

Now I am not sure what exp is at all if it has a supposed Position property.

What? game.StarterGui’s contents are replicated into a player’s PlayerGui, access that by doing

    local PlayerGui = player:WaitForChild("PlayerGui", 5) 
    -- returns nil if the instance wasn't found within 5 seconds
  • Implement some sort of debounce mechanism.
  • Use :Connect (capital C), connect is deprecated.

I don’t think any print statement at all will print.

Please, format code; it’ll be better for us (and you) to debug.